<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/device.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/device.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="k">/*</span>
<a name="2" /><span class="True">       2:</span> <span class="k"> * device.h - generic, centralized driver model</span>
<a name="3" /><span class="True">       3:</span> <span class="k"> *</span>
<a name="4" /><span class="True">       4:</span> <span class="k"> * Copyright (c) 2001-2003 Patrick Mochel &lt;mochel@osdl.org&gt;</span>
<a name="5" /><span class="True">       5:</span> <span class="k"> * Copyright (c) 2004-2009 Greg Kroah-Hartman &lt;gregkh@suse.de&gt;</span>
<a name="6" /><span class="True">       6:</span> <span class="k"> * Copyright (c) 2008-2009 Novell Inc.</span>
<a name="7" /><span class="True">       7:</span> <span class="k"> *</span>
<a name="8" /><span class="True">       8:</span> <span class="k"> * This file is released under the GPLv2</span>
<a name="9" /><span class="True">       9:</span> <span class="k"> *</span>
<a name="10" /><span class="True">      10:</span> <span class="k"> * See Documentation/driver-model/ for more information.</span>
<a name="11" /><span class="True">      11:</span> <span class="k"> */</span>
<a name="12" /><span class="True">      12:</span> 
<a name="13" /><span class="True">      13:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_X0RFVklDRV9IX18w"><span class="b">_DEVICE_H_</span></a>
<a name="14" /><span class="True">      14:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X0RFVklDRV9IX18w"><span class="b">_DEVICE_H_</span></a>
<a name="15" /><span class="True">      15:</span> 
<a name="16" /><span class="True">      16:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">ioport</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="17" /><span class="True">      17:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">kobject</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="18" /><span class="True">      18:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">klist</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="19" /><span class="True">      19:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">list</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="20" /><span class="True">      20:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">lockdep</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="21" /><span class="True">      21:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">compiler</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="22" /><span class="True">      22:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">types</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="23" /><span class="True">      23:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">mutex</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="24" /><span class="True">      24:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">pinctrl</span><span class="f">/</span><span class="b">devinfo</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="25" /><span class="True">      25:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">pm</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="26" /><span class="True">      26:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">atomic</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="27" /><span class="True">      27:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">ratelimit</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="28" /><span class="True">      28:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">uidgid</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="29" /><span class="True">      29:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">gfp</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="30" /><span class="True">      30:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="m">asm</span><span class="f">/</span><span class="b">device</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="31" /><span class="True">      31:</span> 
<a name="32" /><span class="True">      32:</span> <span class="m">struct</span> <span class="b">device</span><span class="f">;</span>
<a name="33" /><span class="True">      33:</span> <span class="m">struct</span> <span class="b">device_private</span><span class="f">;</span>
<a name="34" /><span class="True">      34:</span> <span class="m">struct</span> <span class="b">device_driver</span><span class="f">;</span>
<a name="35" /><span class="True">      35:</span> <span class="m">struct</span> <span class="b">driver_private</span><span class="f">;</span>
<a name="36" /><span class="True">      36:</span> <span class="m">struct</span> <span class="b">module</span><span class="f">;</span>
<a name="37" /><span class="True">      37:</span> <span class="m">struct</span> <span class="m">class</span><span class="f">;</span>
<a name="38" /><span class="True">      38:</span> <span class="m">struct</span> <span class="b">subsys_private</span><span class="f">;</span>
<a name="39" /><span class="True">      39:</span> <span class="m">struct</span> <span class="b">bus_type</span><span class="f">;</span>
<a name="40" /><span class="True">      40:</span> <span class="m">struct</span> <span class="b">device_node</span><span class="f">;</span>
<a name="41" /><span class="True">      41:</span> <span class="m">struct</span> <span class="b">iommu_ops</span><span class="f">;</span>
<a name="42" /><span class="True">      42:</span> <span class="m">struct</span> <span class="b">iommu_group</span><span class="f">;</span>
<a name="43" /><span class="True">      43:</span> 
<a name="44" /><span class="True">      44:</span> <span class="m">struct</span> <span class="b">bus_attribute</span> <span class="f">{</span>
<a name="45" /><span class="True">      45:</span>     <span class="m">struct</span> <span class="b">attribute</span>    <span class="b">attr</span><span class="f">;</span>
<a name="46" /><span class="True">      46:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">show</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="47" /><span class="True">      47:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">store</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="48" /><span class="True">      48:</span> <span class="f">}</span><span class="f">;</span>
<a name="49" /><span class="True">      49:</span> 
<a name="50" /><span class="True">      50:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX0FUVFJfMA__"><span class="b">BUS_ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span>    \
<a name="51" /><span class="True">      51:</span>     <span class="m">struct</span> <span class="b">bus_attribute</span> <span class="b">bus_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span>
<a name="52" /><span class="True">      52:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX0FUVFJfUldfMA__"><span class="b">BUS_ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="53" /><span class="True">      53:</span>     <span class="m">struct</span> <span class="b">bus_attribute</span> <span class="b">bus_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JXXzA_"><span class="b">__ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="54" /><span class="True">      54:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX0FUVFJfUk9fMA__"><span class="b">BUS_ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="55" /><span class="True">      55:</span>     <span class="m">struct</span> <span class="b">bus_attribute</span> <span class="b">bus_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JPXzA_"><span class="b">__ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="56" /><span class="True">      56:</span> 
<a name="57" /><span class="True">      57:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">bus_create_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="f">,</span>
<a name="58" /><span class="True">      58:</span>                     <span class="m">struct</span> <span class="b">bus_attribute</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="59" /><span class="True">      59:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">bus_remove_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">bus_attribute</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="60" /><span class="True">      60:</span> 
<a name="61" /><span class="True">      61:</span> <span class="k">/**</span>
<a name="62" /><span class="True">      62:</span> <span class="k"> * struct bus_type - The bus type of the device</span>
<a name="63" /><span class="True">      63:</span> <span class="k"> *</span>
<a name="64" /><span class="True">      64:</span> <span class="k"> * @name:    The name of the bus.</span>
<a name="65" /><span class="True">      65:</span> <span class="k"> * @dev_name:    Used for subsystems to enumerate devices like (&quot;foo%u&quot;, dev-&gt;id).</span>
<a name="66" /><span class="True">      66:</span> <span class="k"> * @dev_root:    Default device to use as the parent.</span>
<a name="67" /><span class="True">      67:</span> <span class="k"> * @dev_attrs:    Default attributes of the devices on the bus.</span>
<a name="68" /><span class="True">      68:</span> <span class="k"> * @bus_groups:    Default attributes of the bus.</span>
<a name="69" /><span class="True">      69:</span> <span class="k"> * @dev_groups:    Default attributes of the devices on the bus.</span>
<a name="70" /><span class="True">      70:</span> <span class="k"> * @drv_groups: Default attributes of the device drivers on the bus.</span>
<a name="71" /><span class="True">      71:</span> <span class="k"> * @match:    Called, perhaps multiple times, whenever a new device or driver</span>
<a name="72" /><span class="True">      72:</span> <span class="k"> *        is added for this bus. It should return a nonzero value if the</span>
<a name="73" /><span class="True">      73:</span> <span class="k"> *        given device can be handled by the given driver.</span>
<a name="74" /><span class="True">      74:</span> <span class="k"> * @uevent:    Called when a device is added, removed, or a few other things</span>
<a name="75" /><span class="True">      75:</span> <span class="k"> *        that generate uevents to add the environment variables.</span>
<a name="76" /><span class="True">      76:</span> <span class="k"> * @probe:    Called when a new device or driver add to this bus, and callback</span>
<a name="77" /><span class="True">      77:</span> <span class="k"> *        the specific driver&apos;s probe to initial the matched device.</span>
<a name="78" /><span class="True">      78:</span> <span class="k"> * @remove:    Called when a device removed from this bus.</span>
<a name="79" /><span class="True">      79:</span> <span class="k"> * @shutdown:    Called at shut-down time to quiesce the device.</span>
<a name="80" /><span class="True">      80:</span> <span class="k"> *</span>
<a name="81" /><span class="True">      81:</span> <span class="k"> * @online:    Called to put the device back online (after offlining it).</span>
<a name="82" /><span class="True">      82:</span> <span class="k"> * @offline:    Called to put the device offline for hot-removal. May fail.</span>
<a name="83" /><span class="True">      83:</span> <span class="k"> *</span>
<a name="84" /><span class="True">      84:</span> <span class="k"> * @suspend:    Called when a device on this bus wants to go to sleep mode.</span>
<a name="85" /><span class="True">      85:</span> <span class="k"> * @resume:    Called to bring a device on this bus out of sleep mode.</span>
<a name="86" /><span class="True">      86:</span> <span class="k"> * @pm:        Power management operations of this bus, callback the specific</span>
<a name="87" /><span class="True">      87:</span> <span class="k"> *        device driver&apos;s pm-ops.</span>
<a name="88" /><span class="True">      88:</span> <span class="k"> * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU</span>
<a name="89" /><span class="True">      89:</span> <span class="k"> *              driver implementations to a bus and allow the driver to do</span>
<a name="90" /><span class="True">      90:</span> <span class="k"> *              bus-specific setup</span>
<a name="91" /><span class="True">      91:</span> <span class="k"> * @p:        The private data of the driver core, only the driver core can</span>
<a name="92" /><span class="True">      92:</span> <span class="k"> *        touch this.</span>
<a name="93" /><span class="True">      93:</span> <span class="k"> * @lock_key:    Lock class key for use by the lock validator</span>
<a name="94" /><span class="True">      94:</span> <span class="k"> *</span>
<a name="95" /><span class="True">      95:</span> <span class="k"> * A bus is a channel between the processor and one or more devices. For the</span>
<a name="96" /><span class="True">      96:</span> <span class="k"> * purposes of the device model, all devices are connected via a bus, even if</span>
<a name="97" /><span class="True">      97:</span> <span class="k"> * it is an internal, virtual, &quot;platform&quot; bus. Buses can plug into each other.</span>
<a name="98" /><span class="True">      98:</span> <span class="k"> * A USB controller is usually a PCI device, for example. The device model</span>
<a name="99" /><span class="True">      99:</span> <span class="k"> * represents the actual connections between buses and the devices they control.</span>
<a name="100" /><span class="True">     100:</span> <span class="k"> * A bus is represented by the bus_type structure. It contains the name, the</span>
<a name="101" /><span class="True">     101:</span> <span class="k"> * default attributes, the bus&apos; methods, PM operations, and the driver core&apos;s</span>
<a name="102" /><span class="True">     102:</span> <span class="k"> * private data.</span>
<a name="103" /><span class="True">     103:</span> <span class="k"> */</span>
<a name="104" /><span class="True">     104:</span> <span class="m">struct</span> <span class="b">bus_type</span> <span class="f">{</span>
<a name="105" /><span class="True">     105:</span>     <span class="m">const</span> <span class="m">char</span>        <span class="f">*</span><span class="b">name</span><span class="f">;</span>
<a name="106" /><span class="True">     106:</span>     <span class="m">const</span> <span class="m">char</span>        <span class="f">*</span><span class="b">dev_name</span><span class="f">;</span>
<a name="107" /><span class="True">     107:</span>     <span class="m">struct</span> <span class="b">device</span>        <span class="f">*</span><span class="b">dev_root</span><span class="f">;</span>
<a name="108" /><span class="True">     108:</span>     <span class="m">struct</span> <span class="b">device_attribute</span>    <span class="f">*</span><span class="b">dev_attrs</span><span class="f">;</span>    <span class="k">/* use dev_groups instead */</span>
<a name="109" /><span class="True">     109:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">bus_groups</span><span class="f">;</span>
<a name="110" /><span class="True">     110:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">dev_groups</span><span class="f">;</span>
<a name="111" /><span class="True">     111:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">drv_groups</span><span class="f">;</span>
<a name="112" /><span class="True">     112:</span> 
<a name="113" /><span class="True">     113:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">match</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">drv</span><span class="f">)</span><span class="f">;</span>
<a name="114" /><span class="True">     114:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">uevent</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">kobj_uevent_env</span> <span class="f">*</span><span class="b">env</span><span class="f">)</span><span class="f">;</span>
<a name="115" /><span class="True">     115:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">probe</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="116" /><span class="True">     116:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">remove</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="117" /><span class="True">     117:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">shutdown</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="118" /><span class="True">     118:</span> 
<a name="119" /><span class="True">     119:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">online</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="120" /><span class="True">     120:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">offline</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="121" /><span class="True">     121:</span> 
<a name="122" /><span class="True">     122:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">suspend</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">pm_message_t</span> <span class="b">state</span><span class="f">)</span><span class="f">;</span>
<a name="123" /><span class="True">     123:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">resume</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="124" /><span class="True">     124:</span> 
<a name="125" /><span class="True">     125:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">dev_pm_ops</span> <span class="f">*</span><span class="b">pm</span><span class="f">;</span>
<a name="126" /><span class="True">     126:</span> 
<a name="127" /><span class="True">     127:</span>     <span class="m">struct</span> <span class="b">iommu_ops</span> <span class="f">*</span><span class="b">iommu_ops</span><span class="f">;</span>
<a name="128" /><span class="True">     128:</span> 
<a name="129" /><span class="True">     129:</span>     <span class="m">struct</span> <span class="b">subsys_private</span> <span class="f">*</span><span class="b">p</span><span class="f">;</span>
<a name="130" /><span class="True">     130:</span>     <span class="m">struct</span> <span class="b">lock_class_key</span> <span class="b">lock_key</span><span class="f">;</span>
<a name="131" /><span class="True">     131:</span> <span class="f">}</span><span class="f">;</span>
<a name="132" /><span class="True">     132:</span> 
<a name="133" /><span class="True">     133:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">bus_register</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">)</span><span class="f">;</span>
<a name="134" /><span class="True">     134:</span> 
<a name="135" /><span class="True">     135:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">bus_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">)</span><span class="f">;</span>
<a name="136" /><span class="True">     136:</span> 
<a name="137" /><span class="True">     137:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">bus_rescan_devices</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">)</span><span class="f">;</span>
<a name="138" /><span class="True">     138:</span> 
<a name="139" /><span class="True">     139:</span> <span class="k">/* iterator helpers for buses */</span>
<a name="140" /><span class="True">     140:</span> <span class="m">struct</span> <span class="b">subsys_dev_iter</span> <span class="f">{</span>
<a name="141" /><span class="True">     141:</span>     <span class="m">struct</span> <span class="b">klist_iter</span>        <span class="b">ki</span><span class="f">;</span>
<a name="142" /><span class="True">     142:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">device_type</span>    <span class="f">*</span><span class="b">type</span><span class="f">;</span>
<a name="143" /><span class="True">     143:</span> <span class="f">}</span><span class="f">;</span>
<a name="144" /><span class="True">     144:</span> <span class="m">void</span> <span class="b">subsys_dev_iter_init</span><span class="f">(</span><span class="m">struct</span> <span class="b">subsys_dev_iter</span> <span class="f">*</span><span class="b">iter</span><span class="f">,</span>
<a name="145" /><span class="True">     145:</span>              <span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">subsys</span><span class="f">,</span>
<a name="146" /><span class="True">     146:</span>              <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span>
<a name="147" /><span class="True">     147:</span>              <span class="m">const</span> <span class="m">struct</span> <span class="b">device_type</span> <span class="f">*</span><span class="b">type</span><span class="f">)</span><span class="f">;</span>
<a name="148" /><span class="True">     148:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">subsys_dev_iter_next</span><span class="f">(</span><span class="m">struct</span> <span class="b">subsys_dev_iter</span> <span class="f">*</span><span class="b">iter</span><span class="f">)</span><span class="f">;</span>
<a name="149" /><span class="True">     149:</span> <span class="m">void</span> <span class="b">subsys_dev_iter_exit</span><span class="f">(</span><span class="m">struct</span> <span class="b">subsys_dev_iter</span> <span class="f">*</span><span class="b">iter</span><span class="f">)</span><span class="f">;</span>
<a name="150" /><span class="True">     150:</span> 
<a name="151" /><span class="True">     151:</span> <span class="m">int</span> <span class="b">bus_for_each_dev</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="152" /><span class="True">     152:</span>              <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">fn</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="153" /><span class="True">     153:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">bus_find_device</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span>
<a name="154" /><span class="True">     154:</span>                    <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="155" /><span class="True">     155:</span>                    <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">match</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="156" /><span class="True">     156:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">bus_find_device_by_name</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span>
<a name="157" /><span class="True">     157:</span>                        <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span>
<a name="158" /><span class="True">     158:</span>                        <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">)</span><span class="f">;</span>
<a name="159" /><span class="True">     159:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">subsys_find_device_by_id</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">id</span><span class="f">,</span>
<a name="160" /><span class="True">     160:</span>                     <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">hint</span><span class="f">)</span><span class="f">;</span>
<a name="161" /><span class="True">     161:</span> <span class="m">int</span> <span class="b">bus_for_each_drv</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span>
<a name="162" /><span class="True">     162:</span>              <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span> <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">fn</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="163" /><span class="True">     163:</span> <span class="m">void</span> <span class="b">bus_sort_breadthfirst</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span>
<a name="164" /><span class="True">     164:</span>                <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">compare</span><span class="f">)</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">a</span><span class="f">,</span>
<a name="165" /><span class="True">     165:</span>                       <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">b</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="166" /><span class="True">     166:</span> <span class="k">/*</span>
<a name="167" /><span class="True">     167:</span> <span class="k"> * Bus notifiers: Get notified of addition/removal of devices</span>
<a name="168" /><span class="True">     168:</span> <span class="k"> * and binding/unbinding of drivers to devices.</span>
<a name="169" /><span class="True">     169:</span> <span class="k"> * In the long run, it should be a replacement for the platform</span>
<a name="170" /><span class="True">     170:</span> <span class="k"> * notify hooks.</span>
<a name="171" /><span class="True">     171:</span> <span class="k"> */</span>
<a name="172" /><span class="True">     172:</span> <span class="m">struct</span> <span class="b">notifier_block</span><span class="f">;</span>
<a name="173" /><span class="True">     173:</span> 
<a name="174" /><span class="True">     174:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">bus_register_notifier</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span>
<a name="175" /><span class="True">     175:</span>                  <span class="m">struct</span> <span class="b">notifier_block</span> <span class="f">*</span><span class="b">nb</span><span class="f">)</span><span class="f">;</span>
<a name="176" /><span class="True">     176:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">bus_unregister_notifier</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">,</span>
<a name="177" /><span class="True">     177:</span>                    <span class="m">struct</span> <span class="b">notifier_block</span> <span class="f">*</span><span class="b">nb</span><span class="f">)</span><span class="f">;</span>
<a name="178" /><span class="True">     178:</span> 
<a name="179" /><span class="True">     179:</span> <span class="k">/* All 4 notifers below get called with the target struct device *</span>
<a name="180" /><span class="True">     180:</span> <span class="k"> * as an argument. Note that those functions are likely to be called</span>
<a name="181" /><span class="True">     181:</span> <span class="k"> * with the device lock held in the core, so be careful.</span>
<a name="182" /><span class="True">     182:</span> <span class="k"> */</span>
<a name="183" /><span class="True">     183:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX05PVElGWV9BRERfREVWSUNFXzA_"><span class="b">BUS_NOTIFY_ADD_DEVICE</span></a>        <span class="c">0x00000001</span> <span class="k">/* device added */</span>
<a name="184" /><span class="True">     184:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX05PVElGWV9ERUxfREVWSUNFXzA_"><span class="b">BUS_NOTIFY_DEL_DEVICE</span></a>        <span class="c">0x00000002</span> <span class="k">/* device removed */</span>
<a name="185" /><span class="True">     185:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX05PVElGWV9CSU5EX0RSSVZFUl8w"><span class="b">BUS_NOTIFY_BIND_DRIVER</span></a>        <span class="c">0x00000003</span> <span class="k">/* driver about to be</span>
<a name="186" /><span class="True">     186:</span> <span class="k">                              bound */</span>
<a name="187" /><span class="True">     187:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX05PVElGWV9CT1VORF9EUklWRVJfMA__"><span class="b">BUS_NOTIFY_BOUND_DRIVER</span></a>        <span class="c">0x00000004</span> <span class="k">/* driver bound to device */</span>
<a name="188" /><span class="True">     188:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX05PVElGWV9VTkJJTkRfRFJJVkVSXzA_"><span class="b">BUS_NOTIFY_UNBIND_DRIVER</span></a>    <span class="c">0x00000005</span> <span class="k">/* driver about to be</span>
<a name="189" /><span class="True">     189:</span> <span class="k">                              unbound */</span>
<a name="190" /><span class="True">     190:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_QlVTX05PVElGWV9VTkJPVU5EX0RSSVZFUl8w"><span class="b">BUS_NOTIFY_UNBOUND_DRIVER</span></a>    <span class="c">0x00000006</span> <span class="k">/* driver is unbound</span>
<a name="191" /><span class="True">     191:</span> <span class="k">                              from the device */</span>
<a name="192" /><span class="True">     192:</span> 
<a name="193" /><span class="True">     193:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">kset</span> <span class="f">*</span><span class="b">bus_get_kset</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">)</span><span class="f">;</span>
<a name="194" /><span class="True">     194:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">klist</span> <span class="f">*</span><span class="b">bus_get_device_klist</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">)</span><span class="f">;</span>
<a name="195" /><span class="True">     195:</span> 
<a name="196" /><span class="True">     196:</span> <span class="k">/**</span>
<a name="197" /><span class="True">     197:</span> <span class="k"> * struct device_driver - The basic device driver structure</span>
<a name="198" /><span class="True">     198:</span> <span class="k"> * @name:    Name of the device driver.</span>
<a name="199" /><span class="True">     199:</span> <span class="k"> * @bus:    The bus which the device of this driver belongs to.</span>
<a name="200" /><span class="True">     200:</span> <span class="k"> * @owner:    The module owner.</span>
<a name="201" /><span class="True">     201:</span> <span class="k"> * @mod_name:    Used for built-in modules.</span>
<a name="202" /><span class="True">     202:</span> <span class="k"> * @suppress_bind_attrs: Disables bind/unbind via sysfs.</span>
<a name="203" /><span class="True">     203:</span> <span class="k"> * @of_match_table: The open firmware table.</span>
<a name="204" /><span class="True">     204:</span> <span class="k"> * @acpi_match_table: The ACPI match table.</span>
<a name="205" /><span class="True">     205:</span> <span class="k"> * @probe:    Called to query the existence of a specific device,</span>
<a name="206" /><span class="True">     206:</span> <span class="k"> *        whether this driver can work with it, and bind the driver</span>
<a name="207" /><span class="True">     207:</span> <span class="k"> *        to a specific device.</span>
<a name="208" /><span class="True">     208:</span> <span class="k"> * @remove:    Called when the device is removed from the system to</span>
<a name="209" /><span class="True">     209:</span> <span class="k"> *        unbind a device from this driver.</span>
<a name="210" /><span class="True">     210:</span> <span class="k"> * @shutdown:    Called at shut-down time to quiesce the device.</span>
<a name="211" /><span class="True">     211:</span> <span class="k"> * @suspend:    Called to put the device to sleep mode. Usually to a</span>
<a name="212" /><span class="True">     212:</span> <span class="k"> *        low power state.</span>
<a name="213" /><span class="True">     213:</span> <span class="k"> * @resume:    Called to bring a device from sleep mode.</span>
<a name="214" /><span class="True">     214:</span> <span class="k"> * @groups:    Default attributes that get created by the driver core</span>
<a name="215" /><span class="True">     215:</span> <span class="k"> *        automatically.</span>
<a name="216" /><span class="True">     216:</span> <span class="k"> * @pm:        Power management operations of the device which matched</span>
<a name="217" /><span class="True">     217:</span> <span class="k"> *        this driver.</span>
<a name="218" /><span class="True">     218:</span> <span class="k"> * @p:        Driver core&apos;s private data, no one other than the driver</span>
<a name="219" /><span class="True">     219:</span> <span class="k"> *        core can touch this.</span>
<a name="220" /><span class="True">     220:</span> <span class="k"> *</span>
<a name="221" /><span class="True">     221:</span> <span class="k"> * The device driver-model tracks all of the drivers known to the system.</span>
<a name="222" /><span class="True">     222:</span> <span class="k"> * The main reason for this tracking is to enable the driver core to match</span>
<a name="223" /><span class="True">     223:</span> <span class="k"> * up drivers with new devices. Once drivers are known objects within the</span>
<a name="224" /><span class="True">     224:</span> <span class="k"> * system, however, a number of other things become possible. Device drivers</span>
<a name="225" /><span class="True">     225:</span> <span class="k"> * can export information and configuration variables that are independent</span>
<a name="226" /><span class="True">     226:</span> <span class="k"> * of any specific device.</span>
<a name="227" /><span class="True">     227:</span> <span class="k"> */</span>
<a name="228" /><span class="True">     228:</span> <span class="m">struct</span> <span class="b">device_driver</span> <span class="f">{</span>
<a name="229" /><span class="True">     229:</span>     <span class="m">const</span> <span class="m">char</span>        <span class="f">*</span><span class="b">name</span><span class="f">;</span>
<a name="230" /><span class="True">     230:</span>     <span class="m">struct</span> <span class="b">bus_type</span>        <span class="f">*</span><span class="b">bus</span><span class="f">;</span>
<a name="231" /><span class="True">     231:</span> 
<a name="232" /><span class="True">     232:</span>     <span class="m">struct</span> <span class="b">module</span>        <span class="f">*</span><span class="b">owner</span><span class="f">;</span>
<a name="233" /><span class="True">     233:</span>     <span class="m">const</span> <span class="m">char</span>        <span class="f">*</span><span class="b">mod_name</span><span class="f">;</span>    <span class="k">/* used for built-in modules */</span>
<a name="234" /><span class="True">     234:</span> 
<a name="235" /><span class="True">     235:</span>     <span class="m">bool</span> <span class="b">suppress_bind_attrs</span><span class="f">;</span>    <span class="k">/* disables bind/unbind via sysfs */</span>
<a name="236" /><span class="True">     236:</span> 
<a name="237" /><span class="True">     237:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">of_device_id</span>    <span class="f">*</span><span class="b">of_match_table</span><span class="f">;</span>
<a name="238" /><span class="True">     238:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">acpi_device_id</span>    <span class="f">*</span><span class="b">acpi_match_table</span><span class="f">;</span>
<a name="239" /><span class="True">     239:</span> 
<a name="240" /><span class="True">     240:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">probe</span><span class="f">)</span> <span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="241" /><span class="True">     241:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">remove</span><span class="f">)</span> <span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="242" /><span class="True">     242:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">shutdown</span><span class="f">)</span> <span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="243" /><span class="True">     243:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">suspend</span><span class="f">)</span> <span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">pm_message_t</span> <span class="b">state</span><span class="f">)</span><span class="f">;</span>
<a name="244" /><span class="True">     244:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">resume</span><span class="f">)</span> <span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="245" /><span class="True">     245:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">groups</span><span class="f">;</span>
<a name="246" /><span class="True">     246:</span> 
<a name="247" /><span class="True">     247:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">dev_pm_ops</span> <span class="f">*</span><span class="b">pm</span><span class="f">;</span>
<a name="248" /><span class="True">     248:</span> 
<a name="249" /><span class="True">     249:</span>     <span class="m">struct</span> <span class="b">driver_private</span> <span class="f">*</span><span class="b">p</span><span class="f">;</span>
<a name="250" /><span class="True">     250:</span> <span class="f">}</span><span class="f">;</span>
<a name="251" /><span class="True">     251:</span> 
<a name="252" /><span class="True">     252:</span> 
<a name="253" /><span class="True">     253:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">driver_register</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">drv</span><span class="f">)</span><span class="f">;</span>
<a name="254" /><span class="True">     254:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">driver_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">drv</span><span class="f">)</span><span class="f">;</span>
<a name="255" /><span class="True">     255:</span> 
<a name="256" /><span class="True">     256:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">driver_find</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">,</span>
<a name="257" /><span class="True">     257:</span>                      <span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">bus</span><span class="f">)</span><span class="f">;</span>
<a name="258" /><span class="True">     258:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">driver_probe_done</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="259" /><span class="True">     259:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">wait_for_device_probe</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="260" /><span class="True">     260:</span> 
<a name="261" /><span class="True">     261:</span> 
<a name="262" /><span class="True">     262:</span> <span class="k">/* sysfs interface for exporting driver attributes */</span>
<a name="263" /><span class="True">     263:</span> 
<a name="264" /><span class="True">     264:</span> <span class="m">struct</span> <span class="b">driver_attribute</span> <span class="f">{</span>
<a name="265" /><span class="True">     265:</span>     <span class="m">struct</span> <span class="b">attribute</span> <span class="b">attr</span><span class="f">;</span>
<a name="266" /><span class="True">     266:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">show</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">driver</span><span class="f">,</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="267" /><span class="True">     267:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">store</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">driver</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span>
<a name="268" /><span class="True">     268:</span>              <span class="b">size_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="269" /><span class="True">     269:</span> <span class="f">}</span><span class="f">;</span>
<a name="270" /><span class="True">     270:</span> 
<a name="271" /><span class="True">     271:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RFJJVkVSX0FUVFJfMA__"><span class="b">DRIVER_ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span> \
<a name="272" /><span class="True">     272:</span>     <span class="m">struct</span> <span class="b">driver_attribute</span> <span class="b">driver_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span>
<a name="273" /><span class="True">     273:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RFJJVkVSX0FUVFJfUldfMA__"><span class="b">DRIVER_ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="274" /><span class="True">     274:</span>     <span class="m">struct</span> <span class="b">driver_attribute</span> <span class="b">driver_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JXXzA_"><span class="b">__ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="275" /><span class="True">     275:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RFJJVkVSX0FUVFJfUk9fMA__"><span class="b">DRIVER_ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="276" /><span class="True">     276:</span>     <span class="m">struct</span> <span class="b">driver_attribute</span> <span class="b">driver_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JPXzA_"><span class="b">__ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="277" /><span class="True">     277:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RFJJVkVSX0FUVFJfV09fMA__"><span class="b">DRIVER_ATTR_WO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="278" /><span class="True">     278:</span>     <span class="m">struct</span> <span class="b">driver_attribute</span> <span class="b">driver_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1dPXzA_"><span class="b">__ATTR_WO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="279" /><span class="True">     279:</span> 
<a name="280" /><span class="True">     280:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">driver_create_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">driver</span><span class="f">,</span>
<a name="281" /><span class="True">     281:</span>                     <span class="m">const</span> <span class="m">struct</span> <span class="b">driver_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">)</span><span class="f">;</span>
<a name="282" /><span class="True">     282:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">driver_remove_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">driver</span><span class="f">,</span>
<a name="283" /><span class="True">     283:</span>                    <span class="m">const</span> <span class="m">struct</span> <span class="b">driver_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">)</span><span class="f">;</span>
<a name="284" /><span class="True">     284:</span> 
<a name="285" /><span class="True">     285:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">driver_for_each_device</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">drv</span><span class="f">,</span>
<a name="286" /><span class="True">     286:</span>                            <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span>
<a name="287" /><span class="True">     287:</span>                            <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="288" /><span class="True">     288:</span>                            <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">fn</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="289" /><span class="True">     289:</span>                              <span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="290" /><span class="True">     290:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">driver_find_device</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">drv</span><span class="f">,</span>
<a name="291" /><span class="True">     291:</span>                   <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="292" /><span class="True">     292:</span>                   <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">match</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="293" /><span class="True">     293:</span> 
<a name="294" /><span class="True">     294:</span> <span class="k">/**</span>
<a name="295" /><span class="True">     295:</span> <span class="k"> * struct subsys_interface - interfaces to device functions</span>
<a name="296" /><span class="True">     296:</span> <span class="k"> * @name:       name of the device function</span>
<a name="297" /><span class="True">     297:</span> <span class="k"> * @subsys:     subsytem of the devices to attach to</span>
<a name="298" /><span class="True">     298:</span> <span class="k"> * @node:       the list of functions registered at the subsystem</span>
<a name="299" /><span class="True">     299:</span> <span class="k"> * @add_dev:    device hookup to device function handler</span>
<a name="300" /><span class="True">     300:</span> <span class="k"> * @remove_dev: device hookup to device function handler</span>
<a name="301" /><span class="True">     301:</span> <span class="k"> *</span>
<a name="302" /><span class="True">     302:</span> <span class="k"> * Simple interfaces attached to a subsystem. Multiple interfaces can</span>
<a name="303" /><span class="True">     303:</span> <span class="k"> * attach to a subsystem and its devices. Unlike drivers, they do not</span>
<a name="304" /><span class="True">     304:</span> <span class="k"> * exclusively claim or control devices. Interfaces usually represent</span>
<a name="305" /><span class="True">     305:</span> <span class="k"> * a specific functionality of a subsystem/class of devices.</span>
<a name="306" /><span class="True">     306:</span> <span class="k"> */</span>
<a name="307" /><span class="True">     307:</span> <span class="m">struct</span> <span class="b">subsys_interface</span> <span class="f">{</span>
<a name="308" /><span class="True">     308:</span>     <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">;</span>
<a name="309" /><span class="True">     309:</span>     <span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">subsys</span><span class="f">;</span>
<a name="310" /><span class="True">     310:</span>     <span class="m">struct</span> <span class="b">list_head</span> <span class="b">node</span><span class="f">;</span>
<a name="311" /><span class="True">     311:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">add_dev</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">subsys_interface</span> <span class="f">*</span><span class="b">sif</span><span class="f">)</span><span class="f">;</span>
<a name="312" /><span class="True">     312:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">remove_dev</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">subsys_interface</span> <span class="f">*</span><span class="b">sif</span><span class="f">)</span><span class="f">;</span>
<a name="313" /><span class="True">     313:</span> <span class="f">}</span><span class="f">;</span>
<a name="314" /><span class="True">     314:</span> 
<a name="315" /><span class="True">     315:</span> <span class="m">int</span> <span class="b">subsys_interface_register</span><span class="f">(</span><span class="m">struct</span> <span class="b">subsys_interface</span> <span class="f">*</span><span class="b">sif</span><span class="f">)</span><span class="f">;</span>
<a name="316" /><span class="True">     316:</span> <span class="m">void</span> <span class="b">subsys_interface_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="b">subsys_interface</span> <span class="f">*</span><span class="b">sif</span><span class="f">)</span><span class="f">;</span>
<a name="317" /><span class="True">     317:</span> 
<a name="318" /><span class="True">     318:</span> <span class="m">int</span> <span class="b">subsys_system_register</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">subsys</span><span class="f">,</span>
<a name="319" /><span class="True">     319:</span>                <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">groups</span><span class="f">)</span><span class="f">;</span>
<a name="320" /><span class="True">     320:</span> <span class="m">int</span> <span class="b">subsys_virtual_register</span><span class="f">(</span><span class="m">struct</span> <span class="b">bus_type</span> <span class="f">*</span><span class="b">subsys</span><span class="f">,</span>
<a name="321" /><span class="True">     321:</span>                 <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">groups</span><span class="f">)</span><span class="f">;</span>
<a name="322" /><span class="True">     322:</span> 
<a name="323" /><span class="True">     323:</span> <span class="k">/**</span>
<a name="324" /><span class="True">     324:</span> <span class="k"> * struct class - device classes</span>
<a name="325" /><span class="True">     325:</span> <span class="k"> * @name:    Name of the class.</span>
<a name="326" /><span class="True">     326:</span> <span class="k"> * @owner:    The module owner.</span>
<a name="327" /><span class="True">     327:</span> <span class="k"> * @class_attrs: Default attributes of this class.</span>
<a name="328" /><span class="True">     328:</span> <span class="k"> * @dev_groups:    Default attributes of the devices that belong to the class.</span>
<a name="329" /><span class="True">     329:</span> <span class="k"> * @dev_kobj:    The kobject that represents this class and links it into the hierarchy.</span>
<a name="330" /><span class="True">     330:</span> <span class="k"> * @dev_uevent:    Called when a device is added, removed from this class, or a</span>
<a name="331" /><span class="True">     331:</span> <span class="k"> *        few other things that generate uevents to add the environment</span>
<a name="332" /><span class="True">     332:</span> <span class="k"> *        variables.</span>
<a name="333" /><span class="True">     333:</span> <span class="k"> * @devnode:    Callback to provide the devtmpfs.</span>
<a name="334" /><span class="True">     334:</span> <span class="k"> * @class_release: Called to release this class.</span>
<a name="335" /><span class="True">     335:</span> <span class="k"> * @dev_release: Called to release the device.</span>
<a name="336" /><span class="True">     336:</span> <span class="k"> * @suspend:    Used to put the device to sleep mode, usually to a low power</span>
<a name="337" /><span class="True">     337:</span> <span class="k"> *        state.</span>
<a name="338" /><span class="True">     338:</span> <span class="k"> * @resume:    Used to bring the device from the sleep mode.</span>
<a name="339" /><span class="True">     339:</span> <span class="k"> * @ns_type:    Callbacks so sysfs can detemine namespaces.</span>
<a name="340" /><span class="True">     340:</span> <span class="k"> * @namespace:    Namespace of the device belongs to this class.</span>
<a name="341" /><span class="True">     341:</span> <span class="k"> * @pm:        The default device power management operations of this class.</span>
<a name="342" /><span class="True">     342:</span> <span class="k"> * @p:        The private data of the driver core, no one other than the</span>
<a name="343" /><span class="True">     343:</span> <span class="k"> *        driver core can touch this.</span>
<a name="344" /><span class="True">     344:</span> <span class="k"> *</span>
<a name="345" /><span class="True">     345:</span> <span class="k"> * A class is a higher-level view of a device that abstracts out low-level</span>
<a name="346" /><span class="True">     346:</span> <span class="k"> * implementation details. Drivers may see a SCSI disk or an ATA disk, but,</span>
<a name="347" /><span class="True">     347:</span> <span class="k"> * at the class level, they are all simply disks. Classes allow user space</span>
<a name="348" /><span class="True">     348:</span> <span class="k"> * to work with devices based on what they do, rather than how they are</span>
<a name="349" /><span class="True">     349:</span> <span class="k"> * connected or how they work.</span>
<a name="350" /><span class="True">     350:</span> <span class="k"> */</span>
<a name="351" /><span class="True">     351:</span> <span class="m">struct</span> <span class="m">class</span> <span class="f">{</span>
<a name="352" /><span class="True">     352:</span>     <span class="m">const</span> <span class="m">char</span>        <span class="f">*</span><span class="b">name</span><span class="f">;</span>
<a name="353" /><span class="True">     353:</span>     <span class="m">struct</span> <span class="b">module</span>        <span class="f">*</span><span class="b">owner</span><span class="f">;</span>
<a name="354" /><span class="True">     354:</span> 
<a name="355" /><span class="True">     355:</span>     <span class="m">struct</span> <span class="b">class_attribute</span>        <span class="f">*</span><span class="b">class_attrs</span><span class="f">;</span>
<a name="356" /><span class="True">     356:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span>    <span class="f">*</span><span class="f">*</span><span class="b">dev_groups</span><span class="f">;</span>
<a name="357" /><span class="True">     357:</span>     <span class="m">struct</span> <span class="b">kobject</span>            <span class="f">*</span><span class="b">dev_kobj</span><span class="f">;</span>
<a name="358" /><span class="True">     358:</span> 
<a name="359" /><span class="True">     359:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">dev_uevent</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">kobj_uevent_env</span> <span class="f">*</span><span class="b">env</span><span class="f">)</span><span class="f">;</span>
<a name="360" /><span class="True">     360:</span>     <span class="m">char</span> <span class="f">*</span><span class="f">(</span><span class="f">*</span><span class="b">devnode</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">umode_t</span> <span class="f">*</span><span class="b">mode</span><span class="f">)</span><span class="f">;</span>
<a name="361" /><span class="True">     361:</span> 
<a name="362" /><span class="True">     362:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">class_release</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">)</span><span class="f">;</span>
<a name="363" /><span class="True">     363:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">dev_release</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="364" /><span class="True">     364:</span> 
<a name="365" /><span class="True">     365:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">suspend</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">pm_message_t</span> <span class="b">state</span><span class="f">)</span><span class="f">;</span>
<a name="366" /><span class="True">     366:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">resume</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="367" /><span class="True">     367:</span> 
<a name="368" /><span class="True">     368:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">kobj_ns_type_operations</span> <span class="f">*</span><span class="b">ns_type</span><span class="f">;</span>
<a name="369" /><span class="True">     369:</span>     <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="f">(</span><span class="f">*</span><span class="m">namespace</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="370" /><span class="True">     370:</span> 
<a name="371" /><span class="True">     371:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">dev_pm_ops</span> <span class="f">*</span><span class="b">pm</span><span class="f">;</span>
<a name="372" /><span class="True">     372:</span> 
<a name="373" /><span class="True">     373:</span>     <span class="m">struct</span> <span class="b">subsys_private</span> <span class="f">*</span><span class="b">p</span><span class="f">;</span>
<a name="374" /><span class="True">     374:</span> <span class="f">}</span><span class="f">;</span>
<a name="375" /><span class="True">     375:</span> 
<a name="376" /><span class="True">     376:</span> <span class="m">struct</span> <span class="b">class_dev_iter</span> <span class="f">{</span>
<a name="377" /><span class="True">     377:</span>     <span class="m">struct</span> <span class="b">klist_iter</span>        <span class="b">ki</span><span class="f">;</span>
<a name="378" /><span class="True">     378:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">device_type</span>    <span class="f">*</span><span class="b">type</span><span class="f">;</span>
<a name="379" /><span class="True">     379:</span> <span class="f">}</span><span class="f">;</span>
<a name="380" /><span class="True">     380:</span> 
<a name="381" /><span class="True">     381:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">kobject</span> <span class="f">*</span><span class="b">sysfs_dev_block_kobj</span><span class="f">;</span>
<a name="382" /><span class="True">     382:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">kobject</span> <span class="f">*</span><span class="b">sysfs_dev_char_kobj</span><span class="f">;</span>
<a name="383" /><span class="True">     383:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">__class_register</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span>
<a name="384" /><span class="True">     384:</span>                      <span class="m">struct</span> <span class="b">lock_class_key</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="385" /><span class="True">     385:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">class_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">)</span><span class="f">;</span>
<a name="386" /><span class="True">     386:</span> 
<a name="387" /><span class="True">     387:</span> <span class="k">/* This is a #define to keep the compiler from merging different</span>
<a name="388" /><span class="True">     388:</span> <span class="k"> * instances of the __key variable */</span>
<a name="389" /><span class="True">     389:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Y2xhc3NfcmVnaXN0ZXJfMA__"><span class="b">class_register</span></a><span class="f">(</span><span class="m">class</span><span class="f">)</span>            \
<a name="390" /><span class="True">     390:</span> <span class="f">(</span><span class="f">{</span>                        \
<a name="391" /><span class="True">     391:</span>     <span class="m">static</span> <span class="m">struct</span> <span class="b">lock_class_key</span> <span class="b">__key</span><span class="f">;</span>    \
<a name="392" /><span class="True">     392:</span>     <span class="b">__class_register</span><span class="f">(</span><span class="m">class</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">__key</span><span class="f">)</span><span class="f">;</span>    \
<a name="393" /><span class="True">     393:</span> <span class="f">}</span><span class="f">)</span>
<a name="394" /><span class="True">     394:</span> 
<a name="395" /><span class="True">     395:</span> <span class="m">struct</span> <span class="b">class_compat</span><span class="f">;</span>
<a name="396" /><span class="True">     396:</span> <span class="m">struct</span> <span class="b">class_compat</span> <span class="f">*</span><span class="b">class_compat_register</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">)</span><span class="f">;</span>
<a name="397" /><span class="True">     397:</span> <span class="m">void</span> <span class="b">class_compat_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_compat</span> <span class="f">*</span><span class="b">cls</span><span class="f">)</span><span class="f">;</span>
<a name="398" /><span class="True">     398:</span> <span class="m">int</span> <span class="b">class_compat_create_link</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_compat</span> <span class="f">*</span><span class="b">cls</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="399" /><span class="True">     399:</span>                  <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">device_link</span><span class="f">)</span><span class="f">;</span>
<a name="400" /><span class="True">     400:</span> <span class="m">void</span> <span class="b">class_compat_remove_link</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_compat</span> <span class="f">*</span><span class="b">cls</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="401" /><span class="True">     401:</span>                   <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">device_link</span><span class="f">)</span><span class="f">;</span>
<a name="402" /><span class="True">     402:</span> 
<a name="403" /><span class="True">     403:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">class_dev_iter_init</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_dev_iter</span> <span class="f">*</span><span class="b">iter</span><span class="f">,</span>
<a name="404" /><span class="True">     404:</span>                 <span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span>
<a name="405" /><span class="True">     405:</span>                 <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span>
<a name="406" /><span class="True">     406:</span>                 <span class="m">const</span> <span class="m">struct</span> <span class="b">device_type</span> <span class="f">*</span><span class="b">type</span><span class="f">)</span><span class="f">;</span>
<a name="407" /><span class="True">     407:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">class_dev_iter_next</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_dev_iter</span> <span class="f">*</span><span class="b">iter</span><span class="f">)</span><span class="f">;</span>
<a name="408" /><span class="True">     408:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">class_dev_iter_exit</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_dev_iter</span> <span class="f">*</span><span class="b">iter</span><span class="f">)</span><span class="f">;</span>
<a name="409" /><span class="True">     409:</span> 
<a name="410" /><span class="True">     410:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">class_for_each_device</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span>
<a name="411" /><span class="True">     411:</span>                  <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="412" /><span class="True">     412:</span>                  <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">fn</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="413" /><span class="True">     413:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">class_find_device</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span>
<a name="414" /><span class="True">     414:</span>                     <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span> <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="415" /><span class="True">     415:</span>                     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">match</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="f">,</span> <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="416" /><span class="True">     416:</span> 
<a name="417" /><span class="True">     417:</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">{</span>
<a name="418" /><span class="True">     418:</span>     <span class="m">struct</span> <span class="b">attribute</span> <span class="b">attr</span><span class="f">;</span>
<a name="419" /><span class="True">     419:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">show</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="420" /><span class="True">     420:</span>             <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="421" /><span class="True">     421:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">store</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="422" /><span class="True">     422:</span>             <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="423" /><span class="True">     423:</span> <span class="f">}</span><span class="f">;</span>
<a name="424" /><span class="True">     424:</span> 
<a name="425" /><span class="True">     425:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q0xBU1NfQVRUUl8w"><span class="b">CLASS_ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span> \
<a name="426" /><span class="True">     426:</span>     <span class="m">struct</span> <span class="b">class_attribute</span> <span class="b">class_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span>
<a name="427" /><span class="True">     427:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q0xBU1NfQVRUUl9SV18w"><span class="b">CLASS_ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="428" /><span class="True">     428:</span>     <span class="m">struct</span> <span class="b">class_attribute</span> <span class="b">class_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JXXzA_"><span class="b">__ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="429" /><span class="True">     429:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q0xBU1NfQVRUUl9ST18w"><span class="b">CLASS_ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="430" /><span class="True">     430:</span>     <span class="m">struct</span> <span class="b">class_attribute</span> <span class="b">class_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JPXzA_"><span class="b">__ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="431" /><span class="True">     431:</span> 
<a name="432" /><span class="True">     432:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">class_create_file_ns</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span>
<a name="433" /><span class="True">     433:</span>                          <span class="m">const</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="434" /><span class="True">     434:</span>                          <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">ns</span><span class="f">)</span><span class="f">;</span>
<a name="435" /><span class="True">     435:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">class_remove_file_ns</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span>
<a name="436" /><span class="True">     436:</span>                  <span class="m">const</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="437" /><span class="True">     437:</span>                  <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">ns</span><span class="f">)</span><span class="f">;</span>
<a name="438" /><span class="True">     438:</span> 
<a name="439" /><span class="True">     439:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">class_create_file</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span>
<a name="440" /><span class="True">     440:</span>                     <span class="m">const</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">)</span>
<a name="441" /><span class="True">     441:</span> <span class="f">{</span>
<a name="442" /><span class="True">     442:</span>     <span class="m">return</span> <span class="b">class_create_file_ns</span><span class="f">(</span><span class="m">class</span><span class="f">,</span> <span class="b">attr</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span><span class="f">;</span>
<a name="443" /><span class="True">     443:</span> <span class="f">}</span>
<a name="444" /><span class="True">     444:</span> 
<a name="445" /><span class="True">     445:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">class_remove_file</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span>
<a name="446" /><span class="True">     446:</span>                      <span class="m">const</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">)</span>
<a name="447" /><span class="True">     447:</span> <span class="f">{</span>
<a name="448" /><span class="True">     448:</span>     <span class="m">return</span> <span class="b">class_remove_file_ns</span><span class="f">(</span><span class="m">class</span><span class="f">,</span> <span class="b">attr</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span><span class="f">;</span>
<a name="449" /><span class="True">     449:</span> <span class="f">}</span>
<a name="450" /><span class="True">     450:</span> 
<a name="451" /><span class="True">     451:</span> <span class="k">/* Simple class attribute that is just a static string */</span>
<a name="452" /><span class="True">     452:</span> <span class="m">struct</span> <span class="b">class_attribute_string</span> <span class="f">{</span>
<a name="453" /><span class="True">     453:</span>     <span class="m">struct</span> <span class="b">class_attribute</span> <span class="b">attr</span><span class="f">;</span>
<a name="454" /><span class="True">     454:</span>     <span class="m">char</span> <span class="f">*</span><span class="b">str</span><span class="f">;</span>
<a name="455" /><span class="True">     455:</span> <span class="f">}</span><span class="f">;</span>
<a name="456" /><span class="True">     456:</span> 
<a name="457" /><span class="True">     457:</span> <span class="k">/* Currently read-only only */</span>
<a name="458" /><span class="True">     458:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_X0NMQVNTX0FUVFJfU1RSSU5HXzA_"><span class="b">_CLASS_ATTR_STRING</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_str</span><span class="f">)</span> \
<a name="459" /><span class="True">     459:</span>     <span class="f">{</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">show_class_attr_string</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span><span class="f">,</span> <span class="b">_str</span> <span class="f">}</span>
<a name="460" /><span class="True">     460:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q0xBU1NfQVRUUl9TVFJJTkdfMA__"><span class="b">CLASS_ATTR_STRING</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_str</span><span class="f">)</span> \
<a name="461" /><span class="True">     461:</span>     <span class="m">struct</span> <span class="b">class_attribute_string</span> <span class="b">class_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> \
<a name="462" /><span class="True">     462:</span>         <a href="cpu.c_macros_noref.html#_X0NMQVNTX0FUVFJfU1RSSU5HXzA_"><span class="b">_CLASS_ATTR_STRING</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_str</span><span class="f">)</span>
<a name="463" /><span class="True">     463:</span> 
<a name="464" /><span class="True">     464:</span> <span class="m">extern</span> <span class="b">ssize_t</span> <span class="b">show_class_attr_string</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="m">class</span><span class="f">,</span> <span class="m">struct</span> <span class="b">class_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="465" /><span class="True">     465:</span>                         <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="466" /><span class="True">     466:</span> 
<a name="467" /><span class="True">     467:</span> <span class="m">struct</span> <span class="b">class_interface</span> <span class="f">{</span>
<a name="468" /><span class="True">     468:</span>     <span class="m">struct</span> <span class="b">list_head</span>    <span class="b">node</span><span class="f">;</span>
<a name="469" /><span class="True">     469:</span>     <span class="m">struct</span> <span class="m">class</span>        <span class="f">*</span><span class="m">class</span><span class="f">;</span>
<a name="470" /><span class="True">     470:</span> 
<a name="471" /><span class="True">     471:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">add_dev</span><span class="f">)</span>        <span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">class_interface</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="472" /><span class="True">     472:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">remove_dev</span><span class="f">)</span>    <span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">class_interface</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="473" /><span class="True">     473:</span> <span class="f">}</span><span class="f">;</span>
<a name="474" /><span class="True">     474:</span> 
<a name="475" /><span class="True">     475:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">class_interface_register</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_interface</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="476" /><span class="True">     476:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">class_interface_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="b">class_interface</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="477" /><span class="True">     477:</span> 
<a name="478" /><span class="True">     478:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="m">class</span> <span class="f">*</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">__class_create</span><span class="f">(</span><span class="m">struct</span> <span class="b">module</span> <span class="f">*</span><span class="b">owner</span><span class="f">,</span>
<a name="479" /><span class="True">     479:</span>                           <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">,</span>
<a name="480" /><span class="True">     480:</span>                           <span class="m">struct</span> <span class="b">lock_class_key</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="481" /><span class="True">     481:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">class_destroy</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="b">cls</span><span class="f">)</span><span class="f">;</span>
<a name="482" /><span class="True">     482:</span> 
<a name="483" /><span class="True">     483:</span> <span class="k">/* This is a #define to keep the compiler from merging different</span>
<a name="484" /><span class="True">     484:</span> <span class="k"> * instances of the __key variable */</span>
<a name="485" /><span class="True">     485:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Y2xhc3NfY3JlYXRlXzA_"><span class="b">class_create</span></a><span class="f">(</span><span class="b">owner</span><span class="f">,</span> <span class="b">name</span><span class="f">)</span>        \
<a name="486" /><span class="True">     486:</span> <span class="f">(</span><span class="f">{</span>                        \
<a name="487" /><span class="True">     487:</span>     <span class="m">static</span> <span class="m">struct</span> <span class="b">lock_class_key</span> <span class="b">__key</span><span class="f">;</span>    \
<a name="488" /><span class="True">     488:</span>     <span class="b">__class_create</span><span class="f">(</span><span class="b">owner</span><span class="f">,</span> <span class="b">name</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">__key</span><span class="f">)</span><span class="f">;</span>    \
<a name="489" /><span class="True">     489:</span> <span class="f">}</span><span class="f">)</span>
<a name="490" /><span class="True">     490:</span> 
<a name="491" /><span class="True">     491:</span> <span class="k">/*</span>
<a name="492" /><span class="True">     492:</span> <span class="k"> * The type of device, &quot;struct device&quot; is embedded in. A class</span>
<a name="493" /><span class="True">     493:</span> <span class="k"> * or bus can contain devices of different types</span>
<a name="494" /><span class="True">     494:</span> <span class="k"> * like &quot;partitions&quot; and &quot;disks&quot;, &quot;mouse&quot; and &quot;event&quot;.</span>
<a name="495" /><span class="True">     495:</span> <span class="k"> * This identifies the device type and carries type-specific</span>
<a name="496" /><span class="True">     496:</span> <span class="k"> * information, equivalent to the kobj_type of a kobject.</span>
<a name="497" /><span class="True">     497:</span> <span class="k"> * If &quot;name&quot; is specified, the uevent will contain it in</span>
<a name="498" /><span class="True">     498:</span> <span class="k"> * the DEVTYPE variable.</span>
<a name="499" /><span class="True">     499:</span> <span class="k"> */</span>
<a name="500" /><span class="True">     500:</span> <span class="m">struct</span> <span class="b">device_type</span> <span class="f">{</span>
<a name="501" /><span class="True">     501:</span>     <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">;</span>
<a name="502" /><span class="True">     502:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">groups</span><span class="f">;</span>
<a name="503" /><span class="True">     503:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">uevent</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">kobj_uevent_env</span> <span class="f">*</span><span class="b">env</span><span class="f">)</span><span class="f">;</span>
<a name="504" /><span class="True">     504:</span>     <span class="m">char</span> <span class="f">*</span><span class="f">(</span><span class="f">*</span><span class="b">devnode</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">umode_t</span> <span class="f">*</span><span class="b">mode</span><span class="f">,</span>
<a name="505" /><span class="True">     505:</span>              <span class="b">kuid_t</span> <span class="f">*</span><span class="b">uid</span><span class="f">,</span> <span class="b">kgid_t</span> <span class="f">*</span><span class="b">gid</span><span class="f">)</span><span class="f">;</span>
<a name="506" /><span class="True">     506:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">release</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="507" /><span class="True">     507:</span> 
<a name="508" /><span class="True">     508:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">dev_pm_ops</span> <span class="f">*</span><span class="b">pm</span><span class="f">;</span>
<a name="509" /><span class="True">     509:</span> <span class="f">}</span><span class="f">;</span>
<a name="510" /><span class="True">     510:</span> 
<a name="511" /><span class="True">     511:</span> <span class="k">/* interface for exporting device attributes */</span>
<a name="512" /><span class="True">     512:</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">{</span>
<a name="513" /><span class="True">     513:</span>     <span class="m">struct</span> <span class="b">attribute</span>    <span class="b">attr</span><span class="f">;</span>
<a name="514" /><span class="True">     514:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">show</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="515" /><span class="True">     515:</span>             <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="516" /><span class="True">     516:</span>     <span class="b">ssize_t</span> <span class="f">(</span><span class="f">*</span><span class="b">store</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="517" /><span class="True">     517:</span>              <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="518" /><span class="True">     518:</span> <span class="f">}</span><span class="f">;</span>
<a name="519" /><span class="True">     519:</span> 
<a name="520" /><span class="True">     520:</span> <span class="m">struct</span> <span class="b">dev_ext_attribute</span> <span class="f">{</span>
<a name="521" /><span class="True">     521:</span>     <span class="m">struct</span> <span class="b">device_attribute</span> <span class="b">attr</span><span class="f">;</span>
<a name="522" /><span class="True">     522:</span>     <span class="m">void</span> <span class="f">*</span><span class="b">var</span><span class="f">;</span>
<a name="523" /><span class="True">     523:</span> <span class="f">}</span><span class="f">;</span>
<a name="524" /><span class="True">     524:</span> 
<a name="525" /><span class="True">     525:</span> <span class="b">ssize_t</span> <span class="b">device_show_ulong</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="526" /><span class="True">     526:</span>               <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="527" /><span class="True">     527:</span> <span class="b">ssize_t</span> <span class="b">device_store_ulong</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="528" /><span class="True">     528:</span>                <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="529" /><span class="True">     529:</span> <span class="b">ssize_t</span> <span class="b">device_show_int</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="530" /><span class="True">     530:</span>             <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="531" /><span class="True">     531:</span> <span class="b">ssize_t</span> <span class="b">device_store_int</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="532" /><span class="True">     532:</span>              <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="533" /><span class="True">     533:</span> <span class="b">ssize_t</span> <span class="b">device_show_bool</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="534" /><span class="True">     534:</span>             <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">)</span><span class="f">;</span>
<a name="535" /><span class="True">     535:</span> <span class="b">ssize_t</span> <span class="b">device_store_bool</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">,</span>
<a name="536" /><span class="True">     536:</span>              <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="537" /><span class="True">     537:</span> 
<a name="538" /><span class="True">     538:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX0FUVFJfMA__"><span class="b">DEVICE_ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span> \
<a name="539" /><span class="True">     539:</span>     <span class="m">struct</span> <span class="b">device_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span>
<a name="540" /><span class="True">     540:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX0FUVFJfUldfMA__"><span class="b">DEVICE_ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="541" /><span class="True">     541:</span>     <span class="m">struct</span> <span class="b">device_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JXXzA_"><span class="b">__ATTR_RW</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="542" /><span class="True">     542:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX0FUVFJfUk9fMA__"><span class="b">DEVICE_ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="543" /><span class="True">     543:</span>     <span class="m">struct</span> <span class="b">device_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1JPXzA_"><span class="b">__ATTR_RO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="544" /><span class="True">     544:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX0FUVFJfV09fMA__"><span class="b">DEVICE_ATTR_WO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span> \
<a name="545" /><span class="True">     545:</span>     <span class="m">struct</span> <span class="b">device_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_X19BVFRSX1dPXzA_"><span class="b">__ATTR_WO</span></a><span class="f">(</span><span class="b">_name</span><span class="f">)</span>
<a name="546" /><span class="True">     546:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX1VMT05HX0FUVFJfMA__"><span class="b">DEVICE_ULONG_ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_var</span><span class="f">)</span> \
<a name="547" /><span class="True">     547:</span>     <span class="m">struct</span> <span class="b">dev_ext_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> \
<a name="548" /><span class="True">     548:</span>         <span class="f">{</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">device_show_ulong</span><span class="f">,</span> <span class="b">device_store_ulong</span><span class="f">)</span><span class="f">,</span> <span class="f">&amp;</span><span class="f">(</span><span class="b">_var</span><span class="f">)</span> <span class="f">}</span>
<a name="549" /><span class="True">     549:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX0lOVF9BVFRSXzA_"><span class="b">DEVICE_INT_ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_var</span><span class="f">)</span> \
<a name="550" /><span class="True">     550:</span>     <span class="m">struct</span> <span class="b">dev_ext_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> \
<a name="551" /><span class="True">     551:</span>         <span class="f">{</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">device_show_int</span><span class="f">,</span> <span class="b">device_store_int</span><span class="f">)</span><span class="f">,</span> <span class="f">&amp;</span><span class="f">(</span><span class="b">_var</span><span class="f">)</span> <span class="f">}</span>
<a name="552" /><span class="True">     552:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX0JPT0xfQVRUUl8w"><span class="b">DEVICE_BOOL_ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_var</span><span class="f">)</span> \
<a name="553" /><span class="True">     553:</span>     <span class="m">struct</span> <span class="b">dev_ext_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span> \
<a name="554" /><span class="True">     554:</span>         <span class="f">{</span> <a href="cpu.c_macros_noref.html#_X19BVFRSXzA_"><span class="b">__ATTR</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">device_show_bool</span><span class="f">,</span> <span class="b">device_store_bool</span><span class="f">)</span><span class="f">,</span> <span class="f">&amp;</span><span class="f">(</span><span class="b">_var</span><span class="f">)</span> <span class="f">}</span>
<a name="555" /><span class="True">     555:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVWSUNFX0FUVFJfSUdOT1JFX0xPQ0tERVBfMA__"><span class="b">DEVICE_ATTR_IGNORE_LOCKDEP</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span> \
<a name="556" /><span class="True">     556:</span>     <span class="m">struct</span> <span class="b">device_attribute</span> <span class="b">dev_attr_</span><span class="f">##</span><span class="b">_name</span> <span class="f">=</span>        \
<a name="557" /><span class="True">     557:</span>         <a href="cpu.c_macros_noref.html#_X19BVFRSX0lHTk9SRV9MT0NLREVQXzA_"><span class="b">__ATTR_IGNORE_LOCKDEP</span></a><span class="f">(</span><span class="b">_name</span><span class="f">,</span> <span class="b">_mode</span><span class="f">,</span> <span class="b">_show</span><span class="f">,</span> <span class="b">_store</span><span class="f">)</span>
<a name="558" /><span class="True">     558:</span> 
<a name="559" /><span class="True">     559:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">device_create_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">device</span><span class="f">,</span>
<a name="560" /><span class="True">     560:</span>                   <span class="m">const</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">entry</span><span class="f">)</span><span class="f">;</span>
<a name="561" /><span class="True">     561:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_remove_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="562" /><span class="True">     562:</span>                    <span class="m">const</span> <span class="m">struct</span> <span class="b">device_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">)</span><span class="f">;</span>
<a name="563" /><span class="True">     563:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">device_create_bin_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="564" /><span class="True">     564:</span>                     <span class="m">const</span> <span class="m">struct</span> <span class="b">bin_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">)</span><span class="f">;</span>
<a name="565" /><span class="True">     565:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_remove_bin_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="566" /><span class="True">     566:</span>                    <span class="m">const</span> <span class="m">struct</span> <span class="b">bin_attribute</span> <span class="f">*</span><span class="b">attr</span><span class="f">)</span><span class="f">;</span>
<a name="567" /><span class="True">     567:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">device_schedule_callback_owner</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="568" /><span class="True">     568:</span>         <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">func</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">,</span> <span class="m">struct</span> <span class="b">module</span> <span class="f">*</span><span class="b">owner</span><span class="f">)</span><span class="f">;</span>
<a name="569" /><span class="True">     569:</span> 
<a name="570" /><span class="True">     570:</span> <span class="k">/* This is a macro to avoid include problems with THIS_MODULE */</span>
<a name="571" /><span class="True">     571:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2aWNlX3NjaGVkdWxlX2NhbGxiYWNrXzA_"><span class="b">device_schedule_callback</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">func</span><span class="f">)</span>            \
<a name="572" /><span class="True">     572:</span>     <span class="b">device_schedule_callback_owner</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">func</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_VEhJU19NT0RVTEVfMA__"><span class="b">THIS_MODULE</span></a><span class="f">)</span>
<a name="573" /><span class="True">     573:</span> 
<a name="574" /><span class="True">     574:</span> <span class="k">/* device resource management */</span>
<a name="575" /><span class="True">     575:</span> <span class="m">typedef</span> <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">dr_release_t</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span><span class="f">;</span>
<a name="576" /><span class="True">     576:</span> <span class="m">typedef</span> <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">dr_match_t</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">res</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">match_data</span><span class="f">)</span><span class="f">;</span>
<a name="577" /><span class="True">     577:</span> 
<a name="578" /><span class="False">     578:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_DEBUG_DEVRES</span>
<a name="579" /><span class="False">     579:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span><span class="b">__devres_alloc</span><span class="f">(</span><span class="b">dr_release_t</span> <span class="b">release</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">,</span>
<a name="580" /><span class="False">     580:</span>                  <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">)</span><span class="f">;</span>
<a name="581" /><span class="False">     581:</span> <span class="f">#</span><span class="n">define</span> <span class="b">devres_alloc</span><span class="f">(</span><span class="b">release</span><span class="f">,</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp</span><span class="f">)</span> \
<a name="582" /><span class="False">     582:</span>     <span class="b">__devres_alloc</span><span class="f">(</span><span class="b">release</span><span class="f">,</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp</span><span class="f">,</span> <span class="f">#</span><span class="b">release</span><span class="f">)</span>
<a name="583" /><span class="True">     583:</span> <span class="f">#</span><span class="n">else</span>
<a name="584" /><span class="True">     584:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span><span class="b">devres_alloc</span><span class="f">(</span><span class="b">dr_release_t</span> <span class="b">release</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">)</span><span class="f">;</span>
<a name="585" /><span class="True">     585:</span> <span class="f">#</span><span class="n">endif</span>
<a name="586" /><span class="True">     586:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">devres_for_each_res</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">dr_release_t</span> <span class="b">release</span><span class="f">,</span>
<a name="587" /><span class="True">     587:</span>                 <span class="b">dr_match_t</span> <span class="b">match</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">match_data</span><span class="f">,</span>
<a name="588" /><span class="True">     588:</span>                 <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">fn</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">,</span>
<a name="589" /><span class="True">     589:</span>                 <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">;</span>
<a name="590" /><span class="True">     590:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">devres_free</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span><span class="f">;</span>
<a name="591" /><span class="True">     591:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">devres_add</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span><span class="f">;</span>
<a name="592" /><span class="True">     592:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span><span class="b">devres_find</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">dr_release_t</span> <span class="b">release</span><span class="f">,</span>
<a name="593" /><span class="True">     593:</span>              <span class="b">dr_match_t</span> <span class="b">match</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">match_data</span><span class="f">)</span><span class="f">;</span>
<a name="594" /><span class="True">     594:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span><span class="b">devres_get</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">new_res</span><span class="f">,</span>
<a name="595" /><span class="True">     595:</span>             <span class="b">dr_match_t</span> <span class="b">match</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">match_data</span><span class="f">)</span><span class="f">;</span>
<a name="596" /><span class="True">     596:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span><span class="b">devres_remove</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">dr_release_t</span> <span class="b">release</span><span class="f">,</span>
<a name="597" /><span class="True">     597:</span>                <span class="b">dr_match_t</span> <span class="b">match</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">match_data</span><span class="f">)</span><span class="f">;</span>
<a name="598" /><span class="True">     598:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">devres_destroy</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">dr_release_t</span> <span class="b">release</span><span class="f">,</span>
<a name="599" /><span class="True">     599:</span>               <span class="b">dr_match_t</span> <span class="b">match</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">match_data</span><span class="f">)</span><span class="f">;</span>
<a name="600" /><span class="True">     600:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">devres_release</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">dr_release_t</span> <span class="b">release</span><span class="f">,</span>
<a name="601" /><span class="True">     601:</span>               <span class="b">dr_match_t</span> <span class="b">match</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">match_data</span><span class="f">)</span><span class="f">;</span>
<a name="602" /><span class="True">     602:</span> 
<a name="603" /><span class="True">     603:</span> <span class="k">/* devres group */</span>
<a name="604" /><span class="True">     604:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">devres_open_group</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">id</span><span class="f">,</span>
<a name="605" /><span class="True">     605:</span>                          <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">)</span><span class="f">;</span>
<a name="606" /><span class="True">     606:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">devres_close_group</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">id</span><span class="f">)</span><span class="f">;</span>
<a name="607" /><span class="True">     607:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">devres_remove_group</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">id</span><span class="f">)</span><span class="f">;</span>
<a name="608" /><span class="True">     608:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">devres_release_group</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">id</span><span class="f">)</span><span class="f">;</span>
<a name="609" /><span class="True">     609:</span> 
<a name="610" /><span class="True">     610:</span> <span class="k">/* managed devm_k.alloc/kfree for device drivers */</span>
<a name="611" /><span class="True">     611:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span><span class="b">devm_kmalloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">)</span><span class="f">;</span>
<a name="612" /><span class="True">     612:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="f">*</span><span class="b">devm_kzalloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">)</span>
<a name="613" /><span class="True">     613:</span> <span class="f">{</span>
<a name="614" /><span class="True">     614:</span>     <span class="m">return</span> <span class="b">devm_kmalloc</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp</span> <span class="f">|</span> <a href="cpu.c_macros_ref.html#_X19HRlBfWkVST18w"><span class="b">__GFP_ZERO</span></a><span class="f">)</span><span class="f">;</span>
<a name="615" /><span class="True">     615:</span> <span class="f">}</span>
<a name="616" /><span class="True">     616:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="f">*</span><span class="b">devm_kmalloc_array</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="617" /><span class="True">     617:</span>                        <span class="b">size_t</span> <span class="b">n</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">flags</span><span class="f">)</span>
<a name="618" /><span class="True">     618:</span> <span class="f">{</span>
<a name="619" /><span class="True">     619:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">size</span> <span class="f">!=</span> <span class="c">0</span> <span class="f">&amp;&amp;</span> <span class="b">n</span> <span class="f">&gt;</span> <a href="cpu.c_macros_ref.html#_U0laRV9NQVhfMA__"><span class="b">SIZE_MAX</span></a> <span class="f">/</span> <span class="b">size</span><span class="f">)</span>
<a name="620" /><span class="True">     620:</span>         <span class="m">return</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="621" /><span class="True">     621:</span>     <span class="m">return</span> <span class="b">devm_kmalloc</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">n</span> <span class="f">*</span> <span class="b">size</span><span class="f">,</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="622" /><span class="True">     622:</span> <span class="f">}</span>
<a name="623" /><span class="True">     623:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="f">*</span><span class="b">devm_kcalloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="624" /><span class="True">     624:</span>                  <span class="b">size_t</span> <span class="b">n</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">size</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">flags</span><span class="f">)</span>
<a name="625" /><span class="True">     625:</span> <span class="f">{</span>
<a name="626" /><span class="True">     626:</span>     <span class="m">return</span> <span class="b">devm_kmalloc_array</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">n</span><span class="f">,</span> <span class="b">size</span><span class="f">,</span> <span class="b">flags</span> <span class="f">|</span> <a href="cpu.c_macros_ref.html#_X19HRlBfWkVST18w"><span class="b">__GFP_ZERO</span></a><span class="f">)</span><span class="f">;</span>
<a name="627" /><span class="True">     627:</span> <span class="f">}</span>
<a name="628" /><span class="True">     628:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">devm_kfree</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">p</span><span class="f">)</span><span class="f">;</span>
<a name="629" /><span class="True">     629:</span> 
<a name="630" /><span class="True">     630:</span> <span class="m">void</span> <a href="cpu.c_macros_ref.html#_X19pb21lbV8w"><span class="b">__iomem</span></a> <span class="f">*</span><span class="b">devm_ioremap_resource</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span><span class="f">;</span>
<a name="631" /><span class="True">     631:</span> <span class="m">void</span> <a href="cpu.c_macros_ref.html#_X19pb21lbV8w"><span class="b">__iomem</span></a> <span class="f">*</span><span class="b">devm_request_and_ioremap</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="632" /><span class="True">     632:</span>             <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span><span class="f">;</span>
<a name="633" /><span class="True">     633:</span> 
<a name="634" /><span class="True">     634:</span> <span class="k">/* allows to add/remove a custom action to devres stack */</span>
<a name="635" /><span class="True">     635:</span> <span class="m">int</span> <span class="b">devm_add_action</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">action</span><span class="f">)</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">;</span>
<a name="636" /><span class="True">     636:</span> <span class="m">void</span> <span class="b">devm_remove_action</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">action</span><span class="f">)</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">;</span>
<a name="637" /><span class="True">     637:</span> 
<a name="638" /><span class="True">     638:</span> <span class="m">struct</span> <span class="b">device_dma_parameters</span> <span class="f">{</span>
<a name="639" /><span class="True">     639:</span>     <span class="k">/*</span>
<a name="640" /><span class="True">     640:</span> <span class="k">     * a low level driver may set these to teach IOMMU code about</span>
<a name="641" /><span class="True">     641:</span> <span class="k">     * sg limitations.</span>
<a name="642" /><span class="True">     642:</span> <span class="k">     */</span>
<a name="643" /><span class="True">     643:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">max_segment_size</span><span class="f">;</span>
<a name="644" /><span class="True">     644:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">segment_boundary_mask</span><span class="f">;</span>
<a name="645" /><span class="True">     645:</span> <span class="f">}</span><span class="f">;</span>
<a name="646" /><span class="True">     646:</span> 
<a name="647" /><span class="True">     647:</span> <span class="m">struct</span> <span class="b">acpi_device</span><span class="f">;</span>
<a name="648" /><span class="True">     648:</span> 
<a name="649" /><span class="True">     649:</span> <span class="m">struct</span> <span class="b">acpi_dev_node</span> <span class="f">{</span>
<a name="650" /><span class="True">     650:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX0FDUElfMA__"><span class="b">CONFIG_ACPI</span></a>
<a name="651" /><span class="True">     651:</span>     <span class="m">struct</span> <span class="b">acpi_device</span> <span class="f">*</span><span class="b">companion</span><span class="f">;</span>
<a name="652" /><span class="True">     652:</span> <span class="f">#</span><span class="n">endif</span>
<a name="653" /><span class="True">     653:</span> <span class="f">}</span><span class="f">;</span>
<a name="654" /><span class="True">     654:</span> 
<a name="655" /><span class="True">     655:</span> <span class="k">/**</span>
<a name="656" /><span class="True">     656:</span> <span class="k"> * struct device - The basic device structure</span>
<a name="657" /><span class="True">     657:</span> <span class="k"> * @parent:    The device&apos;s &quot;parent&quot; device, the device to which it is attached.</span>
<a name="658" /><span class="True">     658:</span> <span class="k"> *         In most cases, a parent device is some sort of bus or host</span>
<a name="659" /><span class="True">     659:</span> <span class="k"> *         controller. If parent is NULL, the device, is a top-level device,</span>
<a name="660" /><span class="True">     660:</span> <span class="k"> *         which is not usually what you want.</span>
<a name="661" /><span class="True">     661:</span> <span class="k"> * @p:        Holds the private data of the driver core portions of the device.</span>
<a name="662" /><span class="True">     662:</span> <span class="k"> *         See the comment of the struct device_private for detail.</span>
<a name="663" /><span class="True">     663:</span> <span class="k"> * @kobj:    A top-level, abstract class from which other classes are derived.</span>
<a name="664" /><span class="True">     664:</span> <span class="k"> * @init_name:    Initial name of the device.</span>
<a name="665" /><span class="True">     665:</span> <span class="k"> * @type:    The type of device.</span>
<a name="666" /><span class="True">     666:</span> <span class="k"> *         This identifies the device type and carries type-specific</span>
<a name="667" /><span class="True">     667:</span> <span class="k"> *         information.</span>
<a name="668" /><span class="True">     668:</span> <span class="k"> * @mutex:    Mutex to synchronize calls to its driver.</span>
<a name="669" /><span class="True">     669:</span> <span class="k"> * @bus:    Type of bus device is on.</span>
<a name="670" /><span class="True">     670:</span> <span class="k"> * @driver:    Which driver has allocated this</span>
<a name="671" /><span class="True">     671:</span> <span class="k"> * @platform_data: Platform data specific to the device.</span>
<a name="672" /><span class="True">     672:</span> <span class="k"> *         Example: For devices on custom boards, as typical of embedded</span>
<a name="673" /><span class="True">     673:</span> <span class="k"> *         and SOC based hardware, Linux often uses platform_data to point</span>
<a name="674" /><span class="True">     674:</span> <span class="k"> *         to board-specific structures describing devices and how they</span>
<a name="675" /><span class="True">     675:</span> <span class="k"> *         are wired.  That can include what ports are available, chip</span>
<a name="676" /><span class="True">     676:</span> <span class="k"> *         variants, which GPIO pins act in what additional roles, and so</span>
<a name="677" /><span class="True">     677:</span> <span class="k"> *         on.  This shrinks the &quot;Board Support Packages&quot; (BSPs) and</span>
<a name="678" /><span class="True">     678:</span> <span class="k"> *         minimizes board-specific #ifdefs in drivers.</span>
<a name="679" /><span class="True">     679:</span> <span class="k"> * @power:    For device power management.</span>
<a name="680" /><span class="True">     680:</span> <span class="k"> *         See Documentation/power/devices.txt for details.</span>
<a name="681" /><span class="True">     681:</span> <span class="k"> * @pm_domain:    Provide callbacks that are executed during system suspend,</span>
<a name="682" /><span class="True">     682:</span> <span class="k"> *         hibernation, system resume and during runtime PM transitions</span>
<a name="683" /><span class="True">     683:</span> <span class="k"> *         along with subsystem-level and driver-level callbacks.</span>
<a name="684" /><span class="True">     684:</span> <span class="k"> * @pins:    For device pin management.</span>
<a name="685" /><span class="True">     685:</span> <span class="k"> *        See Documentation/pinctrl.txt for details.</span>
<a name="686" /><span class="True">     686:</span> <span class="k"> * @numa_node:    NUMA node this device is close to.</span>
<a name="687" /><span class="True">     687:</span> <span class="k"> * @dma_mask:    Dma mask (if dma&apos;ble device).</span>
<a name="688" /><span class="True">     688:</span> <span class="k"> * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all</span>
<a name="689" /><span class="True">     689:</span> <span class="k"> *         hardware supports 64-bit addresses for consistent allocations</span>
<a name="690" /><span class="True">     690:</span> <span class="k"> *         such descriptors.</span>
<a name="691" /><span class="True">     691:</span> <span class="k"> * @dma_parms:    A low level driver may set these to teach IOMMU code about</span>
<a name="692" /><span class="True">     692:</span> <span class="k"> *         segment limitations.</span>
<a name="693" /><span class="True">     693:</span> <span class="k"> * @dma_pools:    Dma pools (if dma&apos;ble device).</span>
<a name="694" /><span class="True">     694:</span> <span class="k"> * @dma_mem:    Internal for coherent mem override.</span>
<a name="695" /><span class="True">     695:</span> <span class="k"> * @cma_area:    Contiguous memory area for dma allocations</span>
<a name="696" /><span class="True">     696:</span> <span class="k"> * @archdata:    For arch-specific additions.</span>
<a name="697" /><span class="True">     697:</span> <span class="k"> * @of_node:    Associated device tree node.</span>
<a name="698" /><span class="True">     698:</span> <span class="k"> * @acpi_node:    Associated ACPI device node.</span>
<a name="699" /><span class="True">     699:</span> <span class="k"> * @devt:    For creating the sysfs &quot;dev&quot;.</span>
<a name="700" /><span class="True">     700:</span> <span class="k"> * @id:        device instance</span>
<a name="701" /><span class="True">     701:</span> <span class="k"> * @devres_lock: Spinlock to protect the resource of the device.</span>
<a name="702" /><span class="True">     702:</span> <span class="k"> * @devres_head: The resources list of the device.</span>
<a name="703" /><span class="True">     703:</span> <span class="k"> * @knode_class: The node used to add the device to the class list.</span>
<a name="704" /><span class="True">     704:</span> <span class="k"> * @class:    The class of the device.</span>
<a name="705" /><span class="True">     705:</span> <span class="k"> * @groups:    Optional attribute groups.</span>
<a name="706" /><span class="True">     706:</span> <span class="k"> * @release:    Callback to free the device after all references have</span>
<a name="707" /><span class="True">     707:</span> <span class="k"> *         gone away. This should be set by the allocator of the</span>
<a name="708" /><span class="True">     708:</span> <span class="k"> *         device (i.e. the bus driver that discovered the device).</span>
<a name="709" /><span class="True">     709:</span> <span class="k"> * @iommu_group: IOMMU group the device belongs to.</span>
<a name="710" /><span class="True">     710:</span> <span class="k"> *</span>
<a name="711" /><span class="True">     711:</span> <span class="k"> * @offline_disabled: If set, the device is permanently online.</span>
<a name="712" /><span class="True">     712:</span> <span class="k"> * @offline:    Set after successful invocation of bus type&apos;s .offline().</span>
<a name="713" /><span class="True">     713:</span> <span class="k"> *</span>
<a name="714" /><span class="True">     714:</span> <span class="k"> * At the lowest level, every device in a Linux system is represented by an</span>
<a name="715" /><span class="True">     715:</span> <span class="k"> * instance of struct device. The device structure contains the information</span>
<a name="716" /><span class="True">     716:</span> <span class="k"> * that the device model core needs to model the system. Most subsystems,</span>
<a name="717" /><span class="True">     717:</span> <span class="k"> * however, track additional information about the devices they host. As a</span>
<a name="718" /><span class="True">     718:</span> <span class="k"> * result, it is rare for devices to be represented by bare device structures;</span>
<a name="719" /><span class="True">     719:</span> <span class="k"> * instead, that structure, like kobject structures, is usually embedded within</span>
<a name="720" /><span class="True">     720:</span> <span class="k"> * a higher-level representation of the device.</span>
<a name="721" /><span class="True">     721:</span> <span class="k"> */</span>
<a name="722" /><span class="True">     722:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">{</span>
<a name="723" /><span class="True">     723:</span>     <span class="m">struct</span> <span class="b">device</span>        <span class="f">*</span><span class="b">parent</span><span class="f">;</span>
<a name="724" /><span class="True">     724:</span> 
<a name="725" /><span class="True">     725:</span>     <span class="m">struct</span> <span class="b">device_private</span>    <span class="f">*</span><span class="b">p</span><span class="f">;</span>
<a name="726" /><span class="True">     726:</span> 
<a name="727" /><span class="True">     727:</span>     <span class="m">struct</span> <span class="b">kobject</span> <span class="b">kobj</span><span class="f">;</span>
<a name="728" /><span class="True">     728:</span>     <span class="m">const</span> <span class="m">char</span>        <span class="f">*</span><span class="b">init_name</span><span class="f">;</span> <span class="k">/* initial name of the device */</span>
<a name="729" /><span class="True">     729:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">device_type</span> <span class="f">*</span><span class="b">type</span><span class="f">;</span>
<a name="730" /><span class="True">     730:</span> 
<a name="731" /><span class="True">     731:</span>     <span class="m">struct</span> <span class="b">mutex</span>        <span class="b">mutex</span><span class="f">;</span>    <span class="k">/* mutex to synchronize calls to</span>
<a name="732" /><span class="True">     732:</span> <span class="k">                     * its driver.</span>
<a name="733" /><span class="True">     733:</span> <span class="k">                     */</span>
<a name="734" /><span class="True">     734:</span> 
<a name="735" /><span class="True">     735:</span>     <span class="m">struct</span> <span class="b">bus_type</span>    <span class="f">*</span><span class="b">bus</span><span class="f">;</span>        <span class="k">/* type of bus device is on */</span>
<a name="736" /><span class="True">     736:</span>     <span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">driver</span><span class="f">;</span>    <span class="k">/* which driver has allocated this</span>
<a name="737" /><span class="True">     737:</span> <span class="k">                       device */</span>
<a name="738" /><span class="True">     738:</span>     <span class="m">void</span>        <span class="f">*</span><span class="b">platform_data</span><span class="f">;</span>    <span class="k">/* Platform specific data, device</span>
<a name="739" /><span class="True">     739:</span> <span class="k">                       core doesn&apos;t touch it */</span>
<a name="740" /><span class="True">     740:</span>     <span class="m">struct</span> <span class="b">dev_pm_info</span>    <span class="b">power</span><span class="f">;</span>
<a name="741" /><span class="True">     741:</span>     <span class="m">struct</span> <span class="b">dev_pm_domain</span>    <span class="f">*</span><span class="b">pm_domain</span><span class="f">;</span>
<a name="742" /><span class="True">     742:</span> 
<a name="743" /><span class="False">     743:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_PINCTRL</span>
<a name="744" /><span class="False">     744:</span>     <span class="m">struct</span> <span class="b">dev_pin_info</span>    <span class="f">*</span><span class="b">pins</span><span class="f">;</span>
<a name="745" /><span class="True">     745:</span> <span class="f">#</span><span class="n">endif</span>
<a name="746" /><span class="True">     746:</span> 
<a name="747" /><span class="True">     747:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05VTUFfMA__"><span class="b">CONFIG_NUMA</span></a>
<a name="748" /><span class="True">     748:</span>     <span class="m">int</span>        <span class="b">numa_node</span><span class="f">;</span>    <span class="k">/* NUMA node this device is close to */</span>
<a name="749" /><span class="True">     749:</span> <span class="f">#</span><span class="n">endif</span>
<a name="750" /><span class="True">     750:</span>     <span class="b">u64</span>        <span class="f">*</span><span class="b">dma_mask</span><span class="f">;</span>    <span class="k">/* dma mask (if dma&apos;able device) */</span>
<a name="751" /><span class="True">     751:</span>     <span class="b">u64</span>        <span class="b">coherent_dma_mask</span><span class="f">;</span><span class="k">/* Like dma_mask, but for</span>
<a name="752" /><span class="True">     752:</span> <span class="k">                         alloc_coherent mappings as</span>
<a name="753" /><span class="True">     753:</span> <span class="k">                         not all hardware supports</span>
<a name="754" /><span class="True">     754:</span> <span class="k">                         64 bit addresses for consistent</span>
<a name="755" /><span class="True">     755:</span> <span class="k">                         allocations such descriptors. */</span>
<a name="756" /><span class="True">     756:</span> 
<a name="757" /><span class="True">     757:</span>     <span class="m">struct</span> <span class="b">device_dma_parameters</span> <span class="f">*</span><span class="b">dma_parms</span><span class="f">;</span>
<a name="758" /><span class="True">     758:</span> 
<a name="759" /><span class="True">     759:</span>     <span class="m">struct</span> <span class="b">list_head</span>    <span class="b">dma_pools</span><span class="f">;</span>    <span class="k">/* dma pools (if dma&apos;ble) */</span>
<a name="760" /><span class="True">     760:</span> 
<a name="761" /><span class="True">     761:</span>     <span class="m">struct</span> <span class="b">dma_coherent_mem</span>    <span class="f">*</span><span class="b">dma_mem</span><span class="f">;</span> <span class="k">/* internal for coherent mem</span>
<a name="762" /><span class="True">     762:</span> <span class="k">                         override */</span>
<a name="763" /><span class="False">     763:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_DMA_CMA</span>
<a name="764" /><span class="False">     764:</span>     <span class="m">struct</span> <span class="b">cma</span> <span class="f">*</span><span class="b">cma_area</span><span class="f">;</span>        <span class="k">/* contiguous memory area for dma</span>
<a name="765" /><span class="False">     765:</span> <span class="k">                       allocations */</span>
<a name="766" /><span class="True">     766:</span> <span class="f">#</span><span class="n">endif</span>
<a name="767" /><span class="True">     767:</span>     <span class="k">/* arch specific additions */</span>
<a name="768" /><span class="True">     768:</span>     <span class="m">struct</span> <span class="b">dev_archdata</span>    <span class="b">archdata</span><span class="f">;</span>
<a name="769" /><span class="True">     769:</span> 
<a name="770" /><span class="True">     770:</span>     <span class="m">struct</span> <span class="b">device_node</span>    <span class="f">*</span><span class="b">of_node</span><span class="f">;</span> <span class="k">/* associated device tree node */</span>
<a name="771" /><span class="True">     771:</span>     <span class="m">struct</span> <span class="b">acpi_dev_node</span>    <span class="b">acpi_node</span><span class="f">;</span> <span class="k">/* associated ACPI device node */</span>
<a name="772" /><span class="True">     772:</span> 
<a name="773" /><span class="True">     773:</span>     <span class="b">dev_t</span>            <span class="b">devt</span><span class="f">;</span>    <span class="k">/* dev_t, creates the sysfs &quot;dev&quot; */</span>
<a name="774" /><span class="True">     774:</span>     <a href="cpu.c_macros_ref.html#_dTMyXzA_"><span class="b">u32</span></a>            <span class="b">id</span><span class="f">;</span>    <span class="k">/* device instance */</span>
<a name="775" /><span class="True">     775:</span> 
<a name="776" /><span class="True">     776:</span>     <span class="b">spinlock_t</span>        <span class="b">devres_lock</span><span class="f">;</span>
<a name="777" /><span class="True">     777:</span>     <span class="m">struct</span> <span class="b">list_head</span>    <span class="b">devres_head</span><span class="f">;</span>
<a name="778" /><span class="True">     778:</span> 
<a name="779" /><span class="True">     779:</span>     <span class="m">struct</span> <span class="b">klist_node</span>    <span class="b">knode_class</span><span class="f">;</span>
<a name="780" /><span class="True">     780:</span>     <span class="m">struct</span> <span class="m">class</span>        <span class="f">*</span><span class="m">class</span><span class="f">;</span>
<a name="781" /><span class="True">     781:</span>     <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">groups</span><span class="f">;</span>    <span class="k">/* optional groups */</span>
<a name="782" /><span class="True">     782:</span> 
<a name="783" /><span class="True">     783:</span>     <span class="m">void</span>    <span class="f">(</span><span class="f">*</span><span class="b">release</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="784" /><span class="True">     784:</span>     <span class="m">struct</span> <span class="b">iommu_group</span>    <span class="f">*</span><span class="b">iommu_group</span><span class="f">;</span>
<a name="785" /><span class="True">     785:</span> 
<a name="786" /><span class="True">     786:</span>     <span class="m">bool</span>            <span class="b">offline_disabled</span><span class="f">:</span><span class="c">1</span><span class="f">;</span>
<a name="787" /><span class="True">     787:</span>     <span class="m">bool</span>            <span class="b">offline</span><span class="f">:</span><span class="c">1</span><span class="f">;</span>
<a name="788" /><span class="True">     788:</span> <span class="f">}</span><span class="f">;</span>
<a name="789" /><span class="True">     789:</span> 
<a name="790" /><span class="True">     790:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">kobj_to_dev</span><span class="f">(</span><span class="m">struct</span> <span class="b">kobject</span> <span class="f">*</span><span class="b">kobj</span><span class="f">)</span>
<a name="791" /><span class="True">     791:</span> <span class="f">{</span>
<a name="792" /><span class="True">     792:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_Y29udGFpbmVyX29mXzA_"><span class="b">container_of</span></a><span class="f">(</span><span class="b">kobj</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span><span class="f">,</span> <span class="b">kobj</span><span class="f">)</span><span class="f">;</span>
<a name="793" /><span class="True">     793:</span> <span class="f">}</span>
<a name="794" /><span class="True">     794:</span> 
<a name="795" /><span class="True">     795:</span> <span class="k">/* Get the wakeup routines, which depend on struct device */</span>
<a name="796" /><span class="True">     796:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">pm_wakeup</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="797" /><span class="True">     797:</span> 
<a name="798" /><span class="True">     798:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">dev_name</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="799" /><span class="True">     799:</span> <span class="f">{</span>
<a name="800" /><span class="True">     800:</span>     <span class="k">/* Use the init name until the kobject becomes available */</span>
<a name="801" /><span class="True">     801:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">init_name</span><span class="f">)</span>
<a name="802" /><span class="True">     802:</span>         <span class="m">return</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">init_name</span><span class="f">;</span>
<a name="803" /><span class="True">     803:</span> 
<a name="804" /><span class="True">     804:</span>     <span class="m">return</span> <span class="b">kobject_name</span><span class="f">(</span><span class="f">&amp;</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">kobj</span><span class="f">)</span><span class="f">;</span>
<a name="805" /><span class="True">     805:</span> <span class="f">}</span>
<a name="806" /><span class="True">     806:</span> 
<a name="807" /><span class="True">     807:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="808" /><span class="True">     808:</span> <span class="m">int</span> <span class="b">dev_set_name</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="809" /><span class="True">     809:</span> 
<a name="810" /><span class="True">     810:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05VTUFfMA__"><span class="b">CONFIG_NUMA</span></a>
<a name="811" /><span class="True">     811:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">dev_to_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="812" /><span class="True">     812:</span> <span class="f">{</span>
<a name="813" /><span class="True">     813:</span>     <span class="m">return</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">numa_node</span><span class="f">;</span>
<a name="814" /><span class="True">     814:</span> <span class="f">}</span>
<a name="815" /><span class="True">     815:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_dev_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span>
<a name="816" /><span class="True">     816:</span> <span class="f">{</span>
<a name="817" /><span class="True">     817:</span>     <span class="b">dev</span><span class="f">-&gt;</span><span class="b">numa_node</span> <span class="f">=</span> <span class="b">node</span><span class="f">;</span>
<a name="818" /><span class="True">     818:</span> <span class="f">}</span>
<a name="819" /><span class="False">     819:</span> <span class="f">#</span><span class="n">else</span>
<a name="820" /><span class="False">     820:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">dev_to_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="821" /><span class="False">     821:</span> <span class="f">{</span>
<a name="822" /><span class="False">     822:</span>     <span class="m">return</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="823" /><span class="False">     823:</span> <span class="f">}</span>
<a name="824" /><span class="False">     824:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_dev_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span>
<a name="825" /><span class="False">     825:</span> <span class="f">{</span>
<a name="826" /><span class="False">     826:</span> <span class="f">}</span>
<a name="827" /><span class="True">     827:</span> <span class="f">#</span><span class="n">endif</span>
<a name="828" /><span class="True">     828:</span> 
<a name="829" /><span class="True">     829:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">pm_subsys_data</span> <span class="f">*</span><span class="b">dev_to_psd</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="830" /><span class="True">     830:</span> <span class="f">{</span>
<a name="831" /><span class="True">     831:</span>     <span class="m">return</span> <span class="b">dev</span> <span class="f">?</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">subsys_data</span> <span class="f">:</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="832" /><span class="True">     832:</span> <span class="f">}</span>
<a name="833" /><span class="True">     833:</span> 
<a name="834" /><span class="True">     834:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">dev_get_uevent_suppress</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="835" /><span class="True">     835:</span> <span class="f">{</span>
<a name="836" /><span class="True">     836:</span>     <span class="m">return</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">kobj</span><span class="f">.</span><span class="b">uevent_suppress</span><span class="f">;</span>
<a name="837" /><span class="True">     837:</span> <span class="f">}</span>
<a name="838" /><span class="True">     838:</span> 
<a name="839" /><span class="True">     839:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">dev_set_uevent_suppress</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">int</span> <span class="b">val</span><span class="f">)</span>
<a name="840" /><span class="True">     840:</span> <span class="f">{</span>
<a name="841" /><span class="True">     841:</span>     <span class="b">dev</span><span class="f">-&gt;</span><span class="b">kobj</span><span class="f">.</span><span class="b">uevent_suppress</span> <span class="f">=</span> <span class="b">val</span><span class="f">;</span>
<a name="842" /><span class="True">     842:</span> <span class="f">}</span>
<a name="843" /><span class="True">     843:</span> 
<a name="844" /><span class="True">     844:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">device_is_registered</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="845" /><span class="True">     845:</span> <span class="f">{</span>
<a name="846" /><span class="True">     846:</span>     <span class="m">return</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">kobj</span><span class="f">.</span><span class="b">state_in_sysfs</span><span class="f">;</span>
<a name="847" /><span class="True">     847:</span> <span class="f">}</span>
<a name="848" /><span class="True">     848:</span> 
<a name="849" /><span class="True">     849:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">device_enable_async_suspend</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="850" /><span class="True">     850:</span> <span class="f">{</span>
<a name="851" /><span class="True">     851:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">is_prepared</span><span class="f">)</span>
<a name="852" /><span class="True">     852:</span>         <span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">async_suspend</span> <span class="f">=</span> <span class="m">true</span><span class="f">;</span>
<a name="853" /><span class="True">     853:</span> <span class="f">}</span>
<a name="854" /><span class="True">     854:</span> 
<a name="855" /><span class="True">     855:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">device_disable_async_suspend</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="856" /><span class="True">     856:</span> <span class="f">{</span>
<a name="857" /><span class="True">     857:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">is_prepared</span><span class="f">)</span>
<a name="858" /><span class="True">     858:</span>         <span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">async_suspend</span> <span class="f">=</span> <span class="m">false</span><span class="f">;</span>
<a name="859" /><span class="True">     859:</span> <span class="f">}</span>
<a name="860" /><span class="True">     860:</span> 
<a name="861" /><span class="True">     861:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">device_async_suspend_enabled</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="862" /><span class="True">     862:</span> <span class="f">{</span>
<a name="863" /><span class="True">     863:</span>     <span class="m">return</span> <span class="f">!</span><span class="f">!</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">async_suspend</span><span class="f">;</span>
<a name="864" /><span class="True">     864:</span> <span class="f">}</span>
<a name="865" /><span class="True">     865:</span> 
<a name="866" /><span class="True">     866:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">pm_suspend_ignore_children</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">bool</span> <span class="b">enable</span><span class="f">)</span>
<a name="867" /><span class="True">     867:</span> <span class="f">{</span>
<a name="868" /><span class="True">     868:</span>     <span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">ignore_children</span> <span class="f">=</span> <span class="b">enable</span><span class="f">;</span>
<a name="869" /><span class="True">     869:</span> <span class="f">}</span>
<a name="870" /><span class="True">     870:</span> 
<a name="871" /><span class="True">     871:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">dev_pm_syscore_device</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">bool</span> <span class="b">val</span><span class="f">)</span>
<a name="872" /><span class="True">     872:</span> <span class="f">{</span>
<a name="873" /><span class="True">     873:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX1BNX1NMRUVQXzA_"><span class="b">CONFIG_PM_SLEEP</span></a>
<a name="874" /><span class="True">     874:</span>     <span class="b">dev</span><span class="f">-&gt;</span><span class="b">power</span><span class="f">.</span><span class="b">syscore</span> <span class="f">=</span> <span class="b">val</span><span class="f">;</span>
<a name="875" /><span class="True">     875:</span> <span class="f">#</span><span class="n">endif</span>
<a name="876" /><span class="True">     876:</span> <span class="f">}</span>
<a name="877" /><span class="True">     877:</span> 
<a name="878" /><span class="True">     878:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">device_lock</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="879" /><span class="True">     879:</span> <span class="f">{</span>
<a name="880" /><span class="True">     880:</span>     <span class="b">mutex_lock</span><span class="f">(</span><span class="f">&amp;</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">mutex</span><span class="f">)</span><span class="f">;</span>
<a name="881" /><span class="True">     881:</span> <span class="f">}</span>
<a name="882" /><span class="True">     882:</span> 
<a name="883" /><span class="True">     883:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">device_trylock</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="884" /><span class="True">     884:</span> <span class="f">{</span>
<a name="885" /><span class="True">     885:</span>     <span class="m">return</span> <span class="b">mutex_trylock</span><span class="f">(</span><span class="f">&amp;</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">mutex</span><span class="f">)</span><span class="f">;</span>
<a name="886" /><span class="True">     886:</span> <span class="f">}</span>
<a name="887" /><span class="True">     887:</span> 
<a name="888" /><span class="True">     888:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">device_unlock</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="889" /><span class="True">     889:</span> <span class="f">{</span>
<a name="890" /><span class="True">     890:</span>     <span class="b">mutex_unlock</span><span class="f">(</span><span class="f">&amp;</span><span class="b">dev</span><span class="f">-&gt;</span><span class="b">mutex</span><span class="f">)</span><span class="f">;</span>
<a name="891" /><span class="True">     891:</span> <span class="f">}</span>
<a name="892" /><span class="True">     892:</span> 
<a name="893" /><span class="True">     893:</span> <span class="m">void</span> <span class="b">driver_init</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="894" /><span class="True">     894:</span> 
<a name="895" /><span class="True">     895:</span> <span class="k">/*</span>
<a name="896" /><span class="True">     896:</span> <span class="k"> * High level routines for use by the bus drivers</span>
<a name="897" /><span class="True">     897:</span> <span class="k"> */</span>
<a name="898" /><span class="True">     898:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">device_register</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="899" /><span class="True">     899:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="900" /><span class="True">     900:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_initialize</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="901" /><span class="True">     901:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">device_add</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="902" /><span class="True">     902:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_del</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="903" /><span class="True">     903:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">device_for_each_child</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="904" /><span class="True">     904:</span>              <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">fn</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="905" /><span class="True">     905:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">device_find_child</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">,</span>
<a name="906" /><span class="True">     906:</span>                 <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">match</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="907" /><span class="True">     907:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">device_rename</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">new_name</span><span class="f">)</span><span class="f">;</span>
<a name="908" /><span class="True">     908:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">device_move</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">new_parent</span><span class="f">,</span>
<a name="909" /><span class="True">     909:</span>                <span class="m">enum</span> <span class="b">dpm_order</span> <span class="b">dpm_order</span><span class="f">)</span><span class="f">;</span>
<a name="910" /><span class="True">     910:</span> <span class="m">extern</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">device_get_devnode</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="911" /><span class="True">     911:</span>                       <span class="b">umode_t</span> <span class="f">*</span><span class="b">mode</span><span class="f">,</span> <span class="b">kuid_t</span> <span class="f">*</span><span class="b">uid</span><span class="f">,</span> <span class="b">kgid_t</span> <span class="f">*</span><span class="b">gid</span><span class="f">,</span>
<a name="912" /><span class="True">     912:</span>                       <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="f">*</span><span class="b">tmp</span><span class="f">)</span><span class="f">;</span>
<a name="913" /><span class="True">     913:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span><span class="b">dev_get_drvdata</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="914" /><span class="True">     914:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">dev_set_drvdata</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">;</span>
<a name="915" /><span class="True">     915:</span> 
<a name="916" /><span class="True">     916:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">device_supports_offline</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="917" /><span class="True">     917:</span> <span class="f">{</span>
<a name="918" /><span class="True">     918:</span>     <span class="m">return</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">bus</span> <span class="f">&amp;&amp;</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">bus</span><span class="f">-&gt;</span><span class="b">offline</span> <span class="f">&amp;&amp;</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">bus</span><span class="f">-&gt;</span><span class="b">online</span><span class="f">;</span>
<a name="919" /><span class="True">     919:</span> <span class="f">}</span>
<a name="920" /><span class="True">     920:</span> 
<a name="921" /><span class="True">     921:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">lock_device_hotplug</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="922" /><span class="True">     922:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">unlock_device_hotplug</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="923" /><span class="True">     923:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">lock_device_hotplug_sysfs</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="924" /><span class="True">     924:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">device_offline</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="925" /><span class="True">     925:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">device_online</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="926" /><span class="True">     926:</span> <span class="k">/*</span>
<a name="927" /><span class="True">     927:</span> <span class="k"> * Root device objects for grouping under /sys/devices</span>
<a name="928" /><span class="True">     928:</span> <span class="k"> */</span>
<a name="929" /><span class="True">     929:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">__root_device_register</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">,</span>
<a name="930" /><span class="True">     930:</span>                          <span class="m">struct</span> <span class="b">module</span> <span class="f">*</span><span class="b">owner</span><span class="f">)</span><span class="f">;</span>
<a name="931" /><span class="True">     931:</span> 
<a name="932" /><span class="True">     932:</span> <span class="k">/*</span>
<a name="933" /><span class="True">     933:</span> <span class="k"> * This is a macro to avoid include problems with THIS_MODULE,</span>
<a name="934" /><span class="True">     934:</span> <span class="k"> * just as per what is done for device_schedule_callback() above.</span>
<a name="935" /><span class="True">     935:</span> <span class="k"> */</span>
<a name="936" /><span class="True">     936:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cm9vdF9kZXZpY2VfcmVnaXN0ZXJfMA__"><span class="b">root_device_register</span></a><span class="f">(</span><span class="b">name</span><span class="f">)</span> \
<a name="937" /><span class="True">     937:</span>     <span class="b">__root_device_register</span><span class="f">(</span><span class="b">name</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_VEhJU19NT0RVTEVfMA__"><span class="b">THIS_MODULE</span></a><span class="f">)</span>
<a name="938" /><span class="True">     938:</span> 
<a name="939" /><span class="True">     939:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">root_device_unregister</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">root</span><span class="f">)</span><span class="f">;</span>
<a name="940" /><span class="True">     940:</span> 
<a name="941" /><span class="True">     941:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="f">*</span><span class="b">dev_get_platdata</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span>
<a name="942" /><span class="True">     942:</span> <span class="f">{</span>
<a name="943" /><span class="True">     943:</span>     <span class="m">return</span> <span class="b">dev</span><span class="f">-&gt;</span><span class="b">platform_data</span><span class="f">;</span>
<a name="944" /><span class="True">     944:</span> <span class="f">}</span>
<a name="945" /><span class="True">     945:</span> 
<a name="946" /><span class="True">     946:</span> <span class="k">/*</span>
<a name="947" /><span class="True">     947:</span> <span class="k"> * Manual binding of a device to driver. See drivers/base/bus.c</span>
<a name="948" /><span class="True">     948:</span> <span class="k"> * for information on use.</span>
<a name="949" /><span class="True">     949:</span> <span class="k"> */</span>
<a name="950" /><span class="True">     950:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">device_bind_driver</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="951" /><span class="True">     951:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_release_driver</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="952" /><span class="True">     952:</span> <span class="m">extern</span> <span class="m">int</span>  <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">device_attach</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="953" /><span class="True">     953:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">driver_attach</span><span class="f">(</span><span class="m">struct</span> <span class="b">device_driver</span> <span class="f">*</span><span class="b">drv</span><span class="f">)</span><span class="f">;</span>
<a name="954" /><span class="True">     954:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a> <span class="b">device_reprobe</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="955" /><span class="True">     955:</span> 
<a name="956" /><span class="True">     956:</span> <span class="k">/*</span>
<a name="957" /><span class="True">     957:</span> <span class="k"> * Easy functions for dynamically creating devices on the fly</span>
<a name="958" /><span class="True">     958:</span> <span class="k"> */</span>
<a name="959" /><span class="True">     959:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">device_create_vargs</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="b">cls</span><span class="f">,</span>
<a name="960" /><span class="True">     960:</span>                       <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span>
<a name="961" /><span class="True">     961:</span>                       <span class="b">dev_t</span> <span class="b">devt</span><span class="f">,</span>
<a name="962" /><span class="True">     962:</span>                       <span class="m">void</span> <span class="f">*</span><span class="b">drvdata</span><span class="f">,</span>
<a name="963" /><span class="True">     963:</span>                       <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span>
<a name="964" /><span class="True">     964:</span>                       <span class="b">va_list</span> <span class="b">vargs</span><span class="f">)</span><span class="f">;</span>
<a name="965" /><span class="True">     965:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">5</span><span class="f">,</span> <span class="c">6</span><span class="f">)</span>
<a name="966" /><span class="True">     966:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">device_create</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="b">cls</span><span class="f">,</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span>
<a name="967" /><span class="True">     967:</span>                  <span class="b">dev_t</span> <span class="b">devt</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">drvdata</span><span class="f">,</span>
<a name="968" /><span class="True">     968:</span>                  <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="969" /><span class="True">     969:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">6</span><span class="f">,</span> <span class="c">7</span><span class="f">)</span>
<a name="970" /><span class="True">     970:</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">device_create_with_groups</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="b">cls</span><span class="f">,</span>
<a name="971" /><span class="True">     971:</span>                  <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span> <span class="b">dev_t</span> <span class="b">devt</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">drvdata</span><span class="f">,</span>
<a name="972" /><span class="True">     972:</span>                  <span class="m">const</span> <span class="m">struct</span> <span class="b">attribute_group</span> <span class="f">*</span><span class="f">*</span><span class="b">groups</span><span class="f">,</span>
<a name="973" /><span class="True">     973:</span>                  <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="974" /><span class="True">     974:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_destroy</span><span class="f">(</span><span class="m">struct</span> <span class="m">class</span> <span class="f">*</span><span class="b">cls</span><span class="f">,</span> <span class="b">dev_t</span> <span class="b">devt</span><span class="f">)</span><span class="f">;</span>
<a name="975" /><span class="True">     975:</span> 
<a name="976" /><span class="True">     976:</span> <span class="k">/*</span>
<a name="977" /><span class="True">     977:</span> <span class="k"> * Platform &quot;fixup&quot; functions - allow the platform to have their say</span>
<a name="978" /><span class="True">     978:</span> <span class="k"> * about devices and actions that the general device layer doesn&apos;t</span>
<a name="979" /><span class="True">     979:</span> <span class="k"> * know about.</span>
<a name="980" /><span class="True">     980:</span> <span class="k"> */</span>
<a name="981" /><span class="True">     981:</span> <span class="k">/* Notify platform of device discovery */</span>
<a name="982" /><span class="True">     982:</span> <span class="m">extern</span> <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">platform_notify</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="983" /><span class="True">     983:</span> 
<a name="984" /><span class="True">     984:</span> <span class="m">extern</span> <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">platform_notify_remove</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="985" /><span class="True">     985:</span> 
<a name="986" /><span class="True">     986:</span> 
<a name="987" /><span class="True">     987:</span> <span class="k">/*</span>
<a name="988" /><span class="True">     988:</span> <span class="k"> * get_device - atomically increment the reference count for the device.</span>
<a name="989" /><span class="True">     989:</span> <span class="k"> *</span>
<a name="990" /><span class="True">     990:</span> <span class="k"> */</span>
<a name="991" /><span class="True">     991:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">get_device</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="992" /><span class="True">     992:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">put_device</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="993" /><span class="True">     993:</span> 
<a name="994" /><span class="True">     994:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX0RFVlRNUEZTXzA_"><span class="b">CONFIG_DEVTMPFS</span></a>
<a name="995" /><span class="True">     995:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">devtmpfs_create_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="996" /><span class="True">     996:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">devtmpfs_delete_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="997" /><span class="True">     997:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">devtmpfs_mount</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">mntdir</span><span class="f">)</span><span class="f">;</span>
<a name="998" /><span class="False">     998:</span> <span class="f">#</span><span class="n">else</span>
<a name="999" /><span class="False">     999:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">devtmpfs_create_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1000" /><span class="False">    1000:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">devtmpfs_delete_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1001" /><span class="False">    1001:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">devtmpfs_mount</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">mountpoint</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1002" /><span class="True">    1002:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1003" /><span class="True">    1003:</span> 
<a name="1004" /><span class="True">    1004:</span> <span class="k">/* drivers/base/power/shutdown.c */</span>
<a name="1005" /><span class="True">    1005:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">device_shutdown</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1006" /><span class="True">    1006:</span> 
<a name="1007" /><span class="True">    1007:</span> <span class="k">/* debugging and troubleshooting/diagnostic helpers. */</span>
<a name="1008" /><span class="True">    1008:</span> <span class="m">extern</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">dev_driver_string</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">)</span><span class="f">;</span>
<a name="1009" /><span class="True">    1009:</span> 
<a name="1010" /><span class="True">    1010:</span> 
<a name="1011" /><span class="True">    1011:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX1BSSU5US18w"><span class="b">CONFIG_PRINTK</span></a>
<a name="1012" /><span class="True">    1012:</span> 
<a name="1013" /><span class="True">    1013:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">3</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span>
<a name="1014" /><span class="True">    1014:</span> <span class="m">int</span> <span class="b">dev_vprintk_emit</span><span class="f">(</span><span class="m">int</span> <span class="b">level</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="1015" /><span class="True">    1015:</span>              <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="b">va_list</span> <span class="b">args</span><span class="f">)</span><span class="f">;</span>
<a name="1016" /><span class="True">    1016:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">3</span><span class="f">,</span> <span class="c">4</span><span class="f">)</span>
<a name="1017" /><span class="True">    1017:</span> <span class="m">int</span> <span class="b">dev_printk_emit</span><span class="f">(</span><span class="m">int</span> <span class="b">level</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1018" /><span class="True">    1018:</span> 
<a name="1019" /><span class="True">    1019:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">3</span><span class="f">,</span> <span class="c">4</span><span class="f">)</span>
<a name="1020" /><span class="True">    1020:</span> <span class="m">int</span> <span class="b">dev_printk</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">level</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="1021" /><span class="True">    1021:</span>            <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1022" /><span class="True">    1022:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1023" /><span class="True">    1023:</span> <span class="m">int</span> <span class="b">dev_emerg</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1024" /><span class="True">    1024:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1025" /><span class="True">    1025:</span> <span class="m">int</span> <span class="b">dev_alert</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1026" /><span class="True">    1026:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1027" /><span class="True">    1027:</span> <span class="m">int</span> <span class="b">dev_crit</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1028" /><span class="True">    1028:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1029" /><span class="True">    1029:</span> <span class="m">int</span> <span class="b">dev_err</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1030" /><span class="True">    1030:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1031" /><span class="True">    1031:</span> <span class="m">int</span> <span class="b">dev_warn</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1032" /><span class="True">    1032:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1033" /><span class="True">    1033:</span> <span class="m">int</span> <span class="b">dev_notice</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1034" /><span class="True">    1034:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1035" /><span class="True">    1035:</span> <span class="m">int</span> <span class="b">_dev_info</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1036" /><span class="True">    1036:</span> 
<a name="1037" /><span class="False">    1037:</span> <span class="f">#</span><span class="n">else</span>
<a name="1038" /><span class="False">    1038:</span> 
<a name="1039" /><span class="False">    1039:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">3</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span>
<a name="1040" /><span class="False">    1040:</span> <span class="m">int</span> <span class="b">dev_vprintk_emit</span><span class="f">(</span><span class="m">int</span> <span class="b">level</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="1041" /><span class="False">    1041:</span>              <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="b">va_list</span> <span class="b">args</span><span class="f">)</span>
<a name="1042" /><span class="False">    1042:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1043" /><span class="False">    1043:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">3</span><span class="f">,</span> <span class="c">4</span><span class="f">)</span>
<a name="1044" /><span class="False">    1044:</span> <span class="m">int</span> <span class="b">dev_printk_emit</span><span class="f">(</span><span class="m">int</span> <span class="b">level</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1045" /><span class="False">    1045:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1046" /><span class="False">    1046:</span> 
<a name="1047" /><span class="False">    1047:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">__dev_printk</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">level</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="1048" /><span class="False">    1048:</span>                    <span class="m">struct</span> <span class="b">va_format</span> <span class="f">*</span><span class="b">vaf</span><span class="f">)</span>
<a name="1049" /><span class="False">    1049:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1050" /><span class="False">    1050:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">3</span><span class="f">,</span> <span class="c">4</span><span class="f">)</span>
<a name="1051" /><span class="False">    1051:</span> <span class="m">int</span> <span class="b">dev_printk</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">level</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="1052" /><span class="False">    1052:</span>            <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1053" /><span class="False">    1053:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1054" /><span class="False">    1054:</span> 
<a name="1055" /><span class="False">    1055:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1056" /><span class="False">    1056:</span> <span class="m">int</span> <span class="b">dev_emerg</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1057" /><span class="False">    1057:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1058" /><span class="False">    1058:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1059" /><span class="False">    1059:</span> <span class="m">int</span> <span class="b">dev_crit</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1060" /><span class="False">    1060:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1061" /><span class="False">    1061:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1062" /><span class="False">    1062:</span> <span class="m">int</span> <span class="b">dev_alert</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1063" /><span class="False">    1063:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1064" /><span class="False">    1064:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1065" /><span class="False">    1065:</span> <span class="m">int</span> <span class="b">dev_err</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1066" /><span class="False">    1066:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1067" /><span class="False">    1067:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1068" /><span class="False">    1068:</span> <span class="m">int</span> <span class="b">dev_warn</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1069" /><span class="False">    1069:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1070" /><span class="False">    1070:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1071" /><span class="False">    1071:</span> <span class="m">int</span> <span class="b">dev_notice</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1072" /><span class="False">    1072:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1073" /><span class="False">    1073:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">2</span><span class="f">,</span> <span class="c">3</span><span class="f">)</span>
<a name="1074" /><span class="False">    1074:</span> <span class="m">int</span> <span class="b">_dev_info</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>
<a name="1075" /><span class="False">    1075:</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="1076" /><span class="False">    1076:</span> 
<a name="1077" /><span class="True">    1077:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1078" /><span class="True">    1078:</span> 
<a name="1079" /><span class="True">    1079:</span> <span class="k">/*</span>
<a name="1080" /><span class="True">    1080:</span> <span class="k"> * Stupid hackaround for existing uses of non-printk uses dev_info</span>
<a name="1081" /><span class="True">    1081:</span> <span class="k"> *</span>
<a name="1082" /><span class="True">    1082:</span> <span class="k"> * Note that the definition of dev_info below is actually _dev_info</span>
<a name="1083" /><span class="True">    1083:</span> <span class="k"> * and a macro is used to avoid redefining dev_info</span>
<a name="1084" /><span class="True">    1084:</span> <span class="k"> */</span>
<a name="1085" /><span class="True">    1085:</span> 
<a name="1086" /><span class="True">    1086:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2luZm9fMA__"><span class="b">dev_info</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="b">arg</span><span class="f">...</span><span class="f">)</span> <span class="b">_dev_info</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">arg</span><span class="f">)</span>
<a name="1087" /><span class="True">    1087:</span> 
<a name="1088" /><span class="False">    1088:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_DYNAMIC_DEBUG</span><span class="f">)</span>
<a name="1089" /><span class="False">    1089:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2RiZ18w"><span class="b">dev_dbg</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>             \
<a name="1090" /><span class="False">    1090:</span> <span class="m">do</span> <span class="f">{</span>                             \
<a name="1091" /><span class="False">    1091:</span>     <a href="cpu.c_macros_noref.html#_ZHluYW1pY19kZXZfZGJnXzA_"><span class="b">dynamic_dev_dbg</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span><span class="f">;</span> \
<a name="1092" /><span class="False">    1092:</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="1093" /><span class="False">    1093:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">DEBUG</span><span class="f">)</span>
<a name="1094" /><span class="False">    1094:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2RiZ18w"><span class="b">dev_dbg</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="b">arg</span><span class="f">...</span><span class="f">)</span>        \
<a name="1095" /><span class="False">    1095:</span>     <span class="b">dev_printk</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_S0VSTl9ERUJVR18w"><span class="b">KERN_DEBUG</span></a><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="f">##</span><span class="b">arg</span><span class="f">)</span>
<a name="1096" /><span class="True">    1096:</span> <span class="f">#</span><span class="n">else</span>
<a name="1097" /><span class="True">    1097:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2RiZ18w"><span class="b">dev_dbg</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="b">arg</span><span class="f">...</span><span class="f">)</span>                \
<a name="1098" /><span class="True">    1098:</span> <span class="f">(</span><span class="f">{</span>                                \
<a name="1099" /><span class="True">    1099:</span>     <span class="m">if</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>                            \
<a name="1100" /><span class="True">    1100:</span>         <span class="b">dev_printk</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_S0VSTl9ERUJVR18w"><span class="b">KERN_DEBUG</span></a><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="f">##</span><span class="b">arg</span><span class="f">)</span><span class="f">;</span>    \
<a name="1101" /><span class="True">    1101:</span>     <span class="c">0</span><span class="f">;</span>                            \
<a name="1102" /><span class="True">    1102:</span> <span class="f">}</span><span class="f">)</span>
<a name="1103" /><span class="True">    1103:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1104" /><span class="True">    1104:</span> 
<a name="1105" /><span class="True">    1105:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><span class="b">dev_level</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>            \
<a name="1106" /><span class="True">    1106:</span> <span class="m">do</span> <span class="f">{</span>                                    \
<a name="1107" /><span class="True">    1107:</span>     <span class="m">static</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JBVEVMSU1JVF9TVEFURV8w"><span class="b">DEFINE_RATELIMIT_STATE</span></a><span class="f">(</span><span class="b">_rs</span><span class="f">,</span>                \
<a name="1108" /><span class="True">    1108:</span>                       <a href="cpu.c_macros_noref.html#_REVGQVVMVF9SQVRFTElNSVRfSU5URVJWQUxfMA__"><span class="b">DEFAULT_RATELIMIT_INTERVAL</span></a><span class="f">,</span>    \
<a name="1109" /><span class="True">    1109:</span>                       <a href="cpu.c_macros_noref.html#_REVGQVVMVF9SQVRFTElNSVRfQlVSU1RfMA__"><span class="b">DEFAULT_RATELIMIT_BURST</span></a><span class="f">)</span><span class="f">;</span>        \
<a name="1110" /><span class="True">    1110:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_noref.html#_X19yYXRlbGltaXRfMA__"><span class="b">__ratelimit</span></a><span class="f">(</span><span class="f">&amp;</span><span class="b">_rs</span><span class="f">)</span><span class="f">)</span>                        \
<a name="1111" /><span class="True">    1111:</span>         <span class="b">dev_level</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span><span class="f">;</span>            \
<a name="1112" /><span class="True">    1112:</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="1113" /><span class="True">    1113:</span> 
<a name="1114" /><span class="True">    1114:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2VtZXJnX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_emerg_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1115" /><span class="True">    1115:</span>     <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><span class="b">dev_emerg</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1116" /><span class="True">    1116:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2FsZXJ0X3JhdGVsaW1pdGVkXzA_"><span class="b">dev_alert_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1117" /><span class="True">    1117:</span>     <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><span class="b">dev_alert</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1118" /><span class="True">    1118:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2NyaXRfcmF0ZWxpbWl0ZWRfMA__"><span class="b">dev_crit_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1119" /><span class="True">    1119:</span>     <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><span class="b">dev_crit</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1120" /><span class="True">    1120:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2Vycl9yYXRlbGltaXRlZF8w"><span class="b">dev_err_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1121" /><span class="True">    1121:</span>     <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><span class="b">dev_err</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1122" /><span class="True">    1122:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X3dhcm5fcmF0ZWxpbWl0ZWRfMA__"><span class="b">dev_warn_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1123" /><span class="True">    1123:</span>     <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><span class="b">dev_warn</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1124" /><span class="True">    1124:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X25vdGljZV9yYXRlbGltaXRlZF8w"><span class="b">dev_notice_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1125" /><span class="True">    1125:</span>     <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><span class="b">dev_notice</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1126" /><span class="True">    1126:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2luZm9fcmF0ZWxpbWl0ZWRfMA__"><span class="b">dev_info_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1127" /><span class="True">    1127:</span>     <a href="cpu.c_macros_noref.html#_ZGV2X2xldmVsX3JhdGVsaW1pdGVkXzA_"><span class="b">dev_level_ratelimited</span></a><span class="f">(</span><a href="cpu.c_macros_noref.html#_ZGV2X2luZm9fMA__"><span class="b">dev_info</span></a><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1128" /><span class="False">    1128:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_DYNAMIC_DEBUG</span><span class="f">)</span>
<a name="1129" /><span class="False">    1129:</span> <span class="k">/* descriptor check is first to prevent flooding with &quot;callbacks suppressed&quot; */</span>
<a name="1130" /><span class="False">    1130:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2RiZ19yYXRlbGltaXRlZF8w"><span class="b">dev_dbg_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1131" /><span class="False">    1131:</span> <span class="m">do</span> <span class="f">{</span>                                    \
<a name="1132" /><span class="False">    1132:</span>     <span class="m">static</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JBVEVMSU1JVF9TVEFURV8w"><span class="b">DEFINE_RATELIMIT_STATE</span></a><span class="f">(</span><span class="b">_rs</span><span class="f">,</span>                \
<a name="1133" /><span class="False">    1133:</span>                       <a href="cpu.c_macros_noref.html#_REVGQVVMVF9SQVRFTElNSVRfSU5URVJWQUxfMA__"><span class="b">DEFAULT_RATELIMIT_INTERVAL</span></a><span class="f">,</span>    \
<a name="1134" /><span class="False">    1134:</span>                       <a href="cpu.c_macros_noref.html#_REVGQVVMVF9SQVRFTElNSVRfQlVSU1RfMA__"><span class="b">DEFAULT_RATELIMIT_BURST</span></a><span class="f">)</span><span class="f">;</span>        \
<a name="1135" /><span class="False">    1135:</span>     <span class="b">DEFINE_DYNAMIC_DEBUG_METADATA</span><span class="f">(</span><span class="b">descriptor</span><span class="f">,</span> <span class="b">fmt</span><span class="f">)</span><span class="f">;</span>            \
<a name="1136" /><span class="False">    1136:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">descriptor</span><span class="f">.</span><span class="b">flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_X0RQUklOVEtfRkxBR1NfUFJJTlRfMA__"><span class="b">_DPRINTK_FLAGS_PRINT</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span>    \
<a name="1137" /><span class="False">    1137:</span>         <a href="cpu.c_macros_noref.html#_X19yYXRlbGltaXRfMA__"><span class="b">__ratelimit</span></a><span class="f">(</span><span class="f">&amp;</span><span class="b">_rs</span><span class="f">)</span><span class="f">)</span>                        \
<a name="1138" /><span class="False">    1138:</span>         <span class="b">__dynamic_dev_dbg</span><span class="f">(</span><span class="f">&amp;</span><span class="b">descriptor</span><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span>        \
<a name="1139" /><span class="False">    1139:</span>                   <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span><span class="f">;</span>            \
<a name="1140" /><span class="False">    1140:</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="1141" /><span class="False">    1141:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">DEBUG</span><span class="f">)</span>
<a name="1142" /><span class="False">    1142:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2RiZ19yYXRlbGltaXRlZF8w"><span class="b">dev_dbg_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>                \
<a name="1143" /><span class="False">    1143:</span> <span class="m">do</span> <span class="f">{</span>                                    \
<a name="1144" /><span class="False">    1144:</span>     <span class="m">static</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JBVEVMSU1JVF9TVEFURV8w"><span class="b">DEFINE_RATELIMIT_STATE</span></a><span class="f">(</span><span class="b">_rs</span><span class="f">,</span>                \
<a name="1145" /><span class="False">    1145:</span>                       <a href="cpu.c_macros_noref.html#_REVGQVVMVF9SQVRFTElNSVRfSU5URVJWQUxfMA__"><span class="b">DEFAULT_RATELIMIT_INTERVAL</span></a><span class="f">,</span>    \
<a name="1146" /><span class="False">    1146:</span>                       <a href="cpu.c_macros_noref.html#_REVGQVVMVF9SQVRFTElNSVRfQlVSU1RfMA__"><span class="b">DEFAULT_RATELIMIT_BURST</span></a><span class="f">)</span><span class="f">;</span>        \
<a name="1147" /><span class="False">    1147:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_noref.html#_X19yYXRlbGltaXRfMA__"><span class="b">__ratelimit</span></a><span class="f">(</span><span class="f">&amp;</span><span class="b">_rs</span><span class="f">)</span><span class="f">)</span>                        \
<a name="1148" /><span class="False">    1148:</span>         <span class="b">dev_printk</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_S0VSTl9ERUJVR18w"><span class="b">KERN_DEBUG</span></a><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span><span class="f">;</span>    \
<a name="1149" /><span class="False">    1149:</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="1150" /><span class="True">    1150:</span> <span class="f">#</span><span class="n">else</span>
<a name="1151" /><span class="True">    1151:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X2RiZ19yYXRlbGltaXRlZF8w"><span class="b">dev_dbg_ratelimited</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span>            \
<a name="1152" /><span class="True">    1152:</span>     <span class="b">no_printk</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_S0VSTl9ERUJVR18w"><span class="b">KERN_DEBUG</span></a> <a href="cpu.c_macros_noref.html#_cHJfZm10XzA_"><span class="b">pr_fmt</span></a><span class="f">(</span><span class="b">fmt</span><span class="f">)</span><span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span>
<a name="1153" /><span class="True">    1153:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1154" /><span class="True">    1154:</span> 
<a name="1155" /><span class="False">    1155:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">VERBOSE_DEBUG</span>
<a name="1156" /><span class="False">    1156:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X3ZkYmdfMA__"><span class="b">dev_vdbg</span></a>    <a href="cpu.c_macros_noref.html#_ZGV2X2RiZ18w"><span class="b">dev_dbg</span></a>
<a name="1157" /><span class="True">    1157:</span> <span class="f">#</span><span class="n">else</span>
<a name="1158" /><span class="True">    1158:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X3ZkYmdfMA__"><span class="b">dev_vdbg</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="b">arg</span><span class="f">...</span><span class="f">)</span>                \
<a name="1159" /><span class="True">    1159:</span> <span class="f">(</span><span class="f">{</span>                                \
<a name="1160" /><span class="True">    1160:</span>     <span class="m">if</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>                            \
<a name="1161" /><span class="True">    1161:</span>         <span class="b">dev_printk</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_S0VSTl9ERUJVR18w"><span class="b">KERN_DEBUG</span></a><span class="f">,</span> <span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="f">##</span><span class="b">arg</span><span class="f">)</span><span class="f">;</span>    \
<a name="1162" /><span class="True">    1162:</span>     <span class="c">0</span><span class="f">;</span>                            \
<a name="1163" /><span class="True">    1163:</span> <span class="f">}</span><span class="f">)</span>
<a name="1164" /><span class="True">    1164:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1165" /><span class="True">    1165:</span> 
<a name="1166" /><span class="True">    1166:</span> <span class="k">/*</span>
<a name="1167" /><span class="True">    1167:</span> <span class="k"> * dev_WARN*() acts like dev_printk(), but with the key difference of</span>
<a name="1168" /><span class="True">    1168:</span> <span class="k"> * using WARN/WARN_ONCE to include file/line information and a backtrace.</span>
<a name="1169" /><span class="True">    1169:</span> <span class="k"> */</span>
<a name="1170" /><span class="True">    1170:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X1dBUk5fMA__"><span class="b">dev_WARN</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="b">arg</span><span class="f">...</span><span class="f">)</span> \
<a name="1171" /><span class="True">    1171:</span>     <a href="cpu.c_macros_ref.html#_V0FSTl8w"><span class="b">WARN</span></a><span class="f">(</span><span class="c">1</span><span class="f">,</span> <span class="e">&quot;%s %s: &quot;</span> <span class="b">format</span><span class="f">,</span> <span class="b">dev_driver_string</span><span class="f">(</span><span class="b">dev</span><span class="f">)</span><span class="f">,</span> <span class="b">dev_name</span><span class="f">(</span><span class="b">dev</span><span class="f">)</span><span class="f">,</span> <span class="f">##</span> <span class="b">arg</span><span class="f">)</span><span class="f">;</span>
<a name="1172" /><span class="True">    1172:</span> 
<a name="1173" /><span class="True">    1173:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2X1dBUk5fT05DRV8w"><span class="b">dev_WARN_ONCE</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">condition</span><span class="f">,</span> <span class="b">format</span><span class="f">,</span> <span class="b">arg</span><span class="f">...</span><span class="f">)</span> \
<a name="1174" /><span class="True">    1174:</span>     <a href="cpu.c_macros_noref.html#_V0FSTl9PTkNFXzA_"><span class="b">WARN_ONCE</span></a><span class="f">(</span><span class="b">condition</span><span class="f">,</span> <span class="e">&quot;%s %s: &quot;</span> <span class="b">format</span><span class="f">,</span> \
<a name="1175" /><span class="True">    1175:</span>             <span class="b">dev_driver_string</span><span class="f">(</span><span class="b">dev</span><span class="f">)</span><span class="f">,</span> <span class="b">dev_name</span><span class="f">(</span><span class="b">dev</span><span class="f">)</span><span class="f">,</span> <span class="f">##</span> <span class="b">arg</span><span class="f">)</span>
<a name="1176" /><span class="True">    1176:</span> 
<a name="1177" /><span class="True">    1177:</span> <span class="k">/* Create alias, so I can be autoloaded. */</span>
<a name="1178" /><span class="True">    1178:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TU9EVUxFX0FMSUFTX0NIQVJERVZfMA__"><span class="b">MODULE_ALIAS_CHARDEV</span></a><span class="f">(</span><span class="b">major</span><span class="f">,</span><span class="b">minor</span><span class="f">)</span> \
<a name="1179" /><span class="True">    1179:</span>     <span class="b">MODULE_ALIAS</span><span class="f">(</span><span class="e">&quot;char-major-&quot;</span> <a href="cpu.c_macros_ref.html#_X19zdHJpbmdpZnlfMA__"><span class="b">__stringify</span></a><span class="f">(</span><span class="b">major</span><span class="f">)</span> <span class="e">&quot;-&quot;</span> <a href="cpu.c_macros_ref.html#_X19zdHJpbmdpZnlfMA__"><span class="b">__stringify</span></a><span class="f">(</span><span class="b">minor</span><span class="f">)</span><span class="f">)</span>
<a name="1180" /><span class="True">    1180:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TU9EVUxFX0FMSUFTX0NIQVJERVZfTUFKT1JfMA__"><span class="b">MODULE_ALIAS_CHARDEV_MAJOR</span></a><span class="f">(</span><span class="b">major</span><span class="f">)</span> \
<a name="1181" /><span class="True">    1181:</span>     <span class="b">MODULE_ALIAS</span><span class="f">(</span><span class="e">&quot;char-major-&quot;</span> <a href="cpu.c_macros_ref.html#_X19zdHJpbmdpZnlfMA__"><span class="b">__stringify</span></a><span class="f">(</span><span class="b">major</span><span class="f">)</span> <span class="e">&quot;-*&quot;</span><span class="f">)</span>
<a name="1182" /><span class="True">    1182:</span> 
<a name="1183" /><span class="False">    1183:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_SYSFS_DEPRECATED</span>
<a name="1184" /><span class="False">    1184:</span> <span class="m">extern</span> <span class="m">long</span> <a href="cpu.c_macros_noref.html#_c3lzZnNfZGVwcmVjYXRlZF8w"><span class="b">sysfs_deprecated</span></a><span class="f">;</span>
<a name="1185" /><span class="True">    1185:</span> <span class="f">#</span><span class="n">else</span>
<a name="1186" /><span class="True">    1186:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_c3lzZnNfZGVwcmVjYXRlZF8w"><span class="b">sysfs_deprecated</span></a> <span class="c">0</span>
<a name="1187" /><span class="True">    1187:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1188" /><span class="True">    1188:</span> 
<a name="1189" /><span class="True">    1189:</span> <span class="k">/**</span>
<a name="1190" /><span class="True">    1190:</span> <span class="k"> * module_driver() - Helper macro for drivers that don&apos;t do anything</span>
<a name="1191" /><span class="True">    1191:</span> <span class="k"> * special in module init/exit. This eliminates a lot of boilerplate.</span>
<a name="1192" /><span class="True">    1192:</span> <span class="k"> * Each module may only use this macro once, and calling it replaces</span>
<a name="1193" /><span class="True">    1193:</span> <span class="k"> * module_init() and module_exit().</span>
<a name="1194" /><span class="True">    1194:</span> <span class="k"> *</span>
<a name="1195" /><span class="True">    1195:</span> <span class="k"> * @__driver: driver name</span>
<a name="1196" /><span class="True">    1196:</span> <span class="k"> * @__register: register function for this driver type</span>
<a name="1197" /><span class="True">    1197:</span> <span class="k"> * @__unregister: unregister function for this driver type</span>
<a name="1198" /><span class="True">    1198:</span> <span class="k"> * @...: Additional arguments to be passed to __register and __unregister.</span>
<a name="1199" /><span class="True">    1199:</span> <span class="k"> *</span>
<a name="1200" /><span class="True">    1200:</span> <span class="k"> * Use this macro to construct bus specific macros for registering</span>
<a name="1201" /><span class="True">    1201:</span> <span class="k"> * drivers, and do not use it on its own.</span>
<a name="1202" /><span class="True">    1202:</span> <span class="k"> */</span>
<a name="1203" /><span class="True">    1203:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_bW9kdWxlX2RyaXZlcl8w"><span class="b">module_driver</span></a><span class="f">(</span><span class="b">__driver</span><span class="f">,</span> <span class="b">__register</span><span class="f">,</span> <span class="b">__unregister</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span> \
<a name="1204" /><span class="True">    1204:</span> <span class="m">static</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19pbml0XzA_"><span class="b">__init</span></a> <span class="b">__driver</span><span class="f">##</span><span class="b">_init</span><span class="f">(</span><span class="m">void</span><span class="f">)</span> \
<a name="1205" /><span class="True">    1205:</span> <span class="f">{</span> \
<a name="1206" /><span class="True">    1206:</span>     <span class="m">return</span> <span class="b">__register</span><span class="f">(</span><span class="f">&amp;</span><span class="f">(</span><span class="b">__driver</span><span class="f">)</span> <span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span><span class="f">;</span> \
<a name="1207" /><span class="True">    1207:</span> <span class="f">}</span> \
<a name="1208" /><span class="True">    1208:</span> <a href="cpu.c_macros_noref.html#_bW9kdWxlX2luaXRfMA__"><span class="b">module_init</span></a><span class="f">(</span><span class="b">__driver</span><span class="f">##</span><span class="b">_init</span><span class="f">)</span><span class="f">;</span> \
<a name="1209" /><span class="True">    1209:</span> <span class="m">static</span> <span class="m">void</span> <a href="cpu.c_macros_noref.html#_X19leGl0XzA_"><span class="b">__exit</span></a> <span class="b">__driver</span><span class="f">##</span><span class="b">_exit</span><span class="f">(</span><span class="m">void</span><span class="f">)</span> \
<a name="1210" /><span class="True">    1210:</span> <span class="f">{</span> \
<a name="1211" /><span class="True">    1211:</span>     <span class="b">__unregister</span><span class="f">(</span><span class="f">&amp;</span><span class="f">(</span><span class="b">__driver</span><span class="f">)</span> <span class="f">,</span> <span class="f">##</span><span class="b">__VA_ARGS__</span><span class="f">)</span><span class="f">;</span> \
<a name="1212" /><span class="True">    1212:</span> <span class="f">}</span> \
<a name="1213" /><span class="True">    1213:</span> <a href="cpu.c_macros_noref.html#_bW9kdWxlX2V4aXRfMA__"><span class="b">module_exit</span></a><span class="f">(</span><span class="b">__driver</span><span class="f">##</span><span class="b">_exit</span><span class="f">)</span><span class="f">;</span>
<a name="1214" /><span class="True">    1214:</span> 
<a name="1215" /><span class="True">    1215:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* _DEVICE_H_ */</span>
<a name="1216" /><span class="True">    1216:</span> </pre>
  </body>
</html>
